Relativelayout With Scrollview Not Scrolling
I'm working on fixing a bug in someone's code and I can't figure out how to get this to scroll correctly. I'm just trying to get the 'question' area to scroll vertically. Currently
Solution 1:
That is because you set the height of the ScrollView
to wrap_content
. Try giving it a fixed height or using a LinearLayout
with weight so it fills the space left over from the other views.
Solution 2:
If you do not want to set it to a specific height, you can also add
android:fillViewport="true"
to your ScrollView
Solution 3:
Your scroll view doesn't have any problem. But, You can not see your scroll bar because your textview has too short text.
Update your code like below.
Scroll bar will be shown up when contents are long than yours automatically.
Good luck, Josh!
<ScrollViewandroid:layout_height= " fill_parent "android:layout_toRightOf="@+id/q"android:layout_marginTop="10dp"android:layout_width="150dp"><TextViewandroid:id="@+id/question"android:text="Test annswer a Test annswer a Test annswer a Test annswer a Test annswer a Test annswer a Test annswer a Test annswer a Test annswer a Test annswer a Test annswer a Test annswer a Test annswer a ....."android:layout_height="fill_parent"android:layout_toRightOf="@+id/q"android:layout_marginTop="10dp"android:layout_width="150dp"android:textColor="#000000"android:textSize="18sp"android:textStyle="bold" /></ScrollView>
Post a Comment for "Relativelayout With Scrollview Not Scrolling"