![](/img/trans.png)
[英]How to make several Buttons and TextView as one section to scroll in android?
[英]android - how to make a textview scroll?
實際上我在textview中顯示一些數據,但它的一半數據已經出現在屏幕上,所以我需要幫助來制作textview滾動或任何其他可以向下滾動屏幕的東西。
任何幫助,將不勝感激!
將TextView放在ScrollView中,如下所示:
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/txt2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="txt2"/>
</ScrollView>
看到這個
TextView textview= (TextView) findViewById(R.id.your_textview_id);
textview.setMovementMethod(new ScrollingMovementMethod());
只需這樣使用它:
<scrollview
(your code)
/>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.