Przewijanie widoku tekstu nie działa
Chcę przewijać tekst w dół iw górę w pionie, aby tekst pojawił się w widoku tekstowym był dłuższy niż miejsce. Jednak poniższe metody, które testowałem, nie działają.
1 -tv1.setMovementMethod(new ScrollingMovementMethod());
Ponadto, przy użyciu tej metody, wzywa doonFling()
metoda przestała działać.
2 - używanie<ScrollView>
w układzie XML. również, gdy używasz tej metody, wywołania doonFling()
metoda przestała działać.
<ScrollView
android:id="@+id/SCROLLER_ID"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:fillViewport="true">
<TextView
android:id="@+id/TEXT_STATUS_ID"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1.0"/>
</ScrollView>
mój TextView w układzie XML jest następujący.
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2.26"
android:background="@drawable/green"
android:gravity="center"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />