Rag*_*har 20 android scrollview textview
我想让垂直滚动条永久可见.目前滚动条仅在我尝试滚动滚动视图中包含的文本视图时出现.这是我的XML声明.
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@id/radio_group"
android:layout_margin="5dp"
android:scrollbars="vertical"
android:scrollbarAlwaysDrawVerticalTrack="true" >
<TextView
android:id="@+id/question"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:textColor="#FF000000"
android:textStyle="bold" />
</ScrollView>
Run Code Online (Sandbox Code Playgroud)
感谢您的时间.
小智 5
我们可以通过 2 种不同的方式来完成,如下所示。
方法 1:在您的 XML 中
android:scrollbars="vertical"
android:fadeScrollbars="false"
Run Code Online (Sandbox Code Playgroud)
方法 2:在您的 Java 代码中
editText.setVerticalScrollBarEnabled(true);
editText.setVerticalscrollbarFading(false);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
24521 次 |
| 最近记录: |