【发布时间】:2016-05-31 03:20:55
【问题描述】:
我的 Android TextView xml 非常简单,如下所示,我使用了样式 ScrollView 但它不会显示滚动条,即使文本超出底部并且我无法看到超出的内容。请问如何启用滚动条? 我认为“match_parent”有问题,但不知道如何解决。谢谢!
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#ffffff">
<TextView
android:id="@+id/textResult"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/buttonRecord"
android:layout_marginTop="16dp"
android:background="@drawable/back"
android:editable="true"
android:height="150dp"
android:text=""
android:enabled="false"
android:scrollbars="vertical"
style="@android:style/Widget.ScrollView"
android:layout_alignRight="@+id/buttonRecord"
android:layout_alignEnd="@+id/buttonRecord"
android:layout_alignLeft="@+id/buttonRecord"
android:layout_alignStart="@+id/buttonRecord" />
</RelativeLayout>
【问题讨论】:
-
你的滚动视图在哪里??并更改问题标题...您正在尝试在 textview 中滚动
-
我认为这是this的重复问题
标签: android textview scrollview