我的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>
如果您想滚动内容,也许尝试给它一个固定的高度?现在由于的原因,高度已设置为wrap_content layout_height
。我不认为你应该使用android:height
在所有
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句