scrollbar - how to add scroll bar in android on justified textview -
i adding scrollbar on text view below last few lines of text cropped , not visible. why happening , how solve this?
xml-
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/back"> <com.abc.xyz.textviewex android:id="@+id/etext1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textsize="@dimen/betxt" android:textcolor="#ffffff" android:layout_marginleft="@dimen/activity_margin" android:layout_marginright="@dimen/activity_margin" android:layout_marginbottom="@dimen/activity_margin" android:layout_margintop="@dimen/activity_margin" android:scrollbars="vertical"/> </linearlayout>
activity-
textview1 = (textviewex) findviewbyid (r.id.etext1); textview1.setmovementmethod(new scrollingmovementmethod());
there 3 things try fix problem:
1)try adding android:maxlines
. add textview.setmovementmethod(new scrollingmovementmethod())
in java code.
2) put android:singleline="true" in layout of textview not become bigger container.
3) try putting android:gravity="bottom|left" in textview's layout , see if align textview bottom left.
i suggest go 1st solution since using android:scrollbars="vertical"
,i t may work you.
Comments
Post a Comment