i have problem project have long text goes off screen , need scrollable fixed text goes off screen right doesn't stay compact in have suggestions? want text in , visible having scroll since lot. force orientation don't want since design bad. tried few solutions there no hope.
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_horizontal"> <scrollview android:layout_width="fill_parent" android:layout_height="fill_parent"> <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:weightsum="1"> <textview android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/abouthusky" android:id="@+id/abouthusky" android:ellipsize="middle" android:layout_weight=".5" android:layout_alignparentbottom="true" android:layout_alignparentleft="true" android:layout_alignparentstart="true" /> </linearlayout> </scrollview>
here image of how looks like: http://i57.tinypic.com/2qt8hvm.png
here fragment code:
public class fragment_list_1 extends android.app.fragment { view rootview; @nullable @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { rootview = inflater.inflate(r.layout.menu_layout_1, container, false); return rootview; } } also know asked in past messed on question , did not provide enough detail.
thank you.
change xml this::
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_horizontal" > <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" > <textview android:id="@+id/abouthusky" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="20dp" android:maxlines="25" android:scrollbars="vertical" android:layout_margin="5dp" android:text="@string/abouthusky" /> </linearlayout> </relativelayout> and in code :
yourtextview.setmovementmethod(new scrollingmovementmethod()) do this.it should work
Comments
Post a Comment