發表文章

目前顯示的是 1月 1, 2019的文章

React : Setting scrollTop on Div doesn't work in a specific case

圖片
0 I have been stuck at this since today morning and I still can't figure out where did I go wrong. I wanted to highlight text inside a textarea input type. I know this isn't possible, but I found a clever solution to cheat the viewer into thinking that. Here is the link to the article and Here is the link to the codeio pen for the project. I have been trying to recreate the same using react and normal javascript but the scrollTop property for div with className highlight just doesn't work. If someone could help me debug what I'm doing wrong, that would be wonderful! class CodeTextArea extends React.Component constructor(props) super(props); this.state = scrollTop: 0, scrollLeft: 0 ; this.setScroll = this.setScroll.bind(this); setScroll(top,left) this.setState(scrollTop: top, scrollLeft: left); render() return( <div class="container"> <div class="backdrop"> <Highlight scrollTop=this.state.scrollTop scrollLeft

how to overlay an imageView inside circular ProgessBar

圖片
0 I have a circular progressBar for background and one for foreground, and i want one ImageView to stretch inside and all over the progressBar . how do i do it? Layout.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:id="@+id/voice_player_item" android:layout_gravity="center" android:orientation="vertical" > <LinearLayout android:background="@drawable/layout_border" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:orientation="vertical"> <LinearLayout android:paddingTop="20dp" android:paddingBottom="20dp"