我正在开发一个应用程序,在其中我必须记录任务。问题是显示具有大数据的任务会扰乱UI。现有的解决方案是使用"…",当用户点击这些点时,一个新的屏幕将显示所有数据。但我不想使用它。另一个选项是使用"v"箭头,当用户触摸它时,字段会扩大。除了这两个,还有其他解决方案吗。更优选的是在同一页面上显示文本。
USe this:-
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/txtView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AAAAAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCDDDDDDDDD" />
</ScrollView>
根据我的说法,你有两个选项:-
- 滚动视图,其中包含textView
- 水平滚动视图,左右箭头作为滑块效果,您可以在其中创建并动态添加textview,每个有100个单词,所以如果你有1000个单词,那么10个孩子们在文本视图中,对用户来说,滑动并看到文本会很神奇取决于你的表现
希望它能有所帮助:)
检查此项:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ScrollView
android:id="@+id/ScrollView01"
android:layout_height="1fill_parent"
android:layout_width="fill_parent">
<TextView
android:id="@+id/TEXT_VIEW1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="This is text view This is text view This is text view This is text view This is text view This is text view This is text view This is text view This is text view This is text view This is text view This is text view This is text view This is text view This is text view" />
<TextView
android:id="@+id/TEXT_VIEW2"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="This is text view This is text view This is text view This is text view This is text view This is text view This is text view This is text view This is text view This is text view This is text view This is text view This is text view This is text view This is text view" />
</ScrollView>
</LinearLayout>