我有以下布局。通过代码更改文本视图时,它们会扩展,下面的内容现在被切断。这是有意的。但是我无法滚动,即使启用了“scrollbarAlwaysDrawVerticalTrack="true"”,从下到上移动手指也不会改变视图。如何启用滚动?
编辑:工作解决方案:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:p1="http://schemas.android.com/apk/res/android"
p1:minWidth="25px"
p1:minHeight="25px"
p1:layout_width="fill_parent"
p1:layout_height="fill_parent"
p1:id="@+id/scrollView1">
<LinearLayout
p1:orientation="vertical"
p1:minWidth="25px"
p1:minHeight="25px"
p1:layout_width="fill_parent"
p1:layout_height="fill_parent"
p1:id="@+id/linearLayout1"
p1:background="#005C2E"
p1:scrollbarAlwaysDrawVerticalTrack="true"
p1:scrollbars="vertical"
p1:scrollbarStyle="insideOverlay">
<TextView
p1:text="Text"
p1:layout_width="fill_parent"
p1:layout_height="wrap_content"
p1:id="@+id/textView1"
p1:textSize="22sp"
p1:textColor="#00005C" />
<TextView
p1:text="Text"
p1:layout_width="fill_parent"
p1:layout_height="wrap_content"
p1:textSize="22sp"
p1:textColor="#5C0000"
p1:id="@+id/textView2" />
<TextView
p1:textSize="22sp"
p1:text="Text"
p1:layout_width="fill_parent"
p1:layout_height="wrap_content"
p1:textColor="#00005C"
p1:id="@+id/textView3" />
<TextView
p1:textSize="22sp"
p1:text="Text"
p1:layout_width="fill_parent"
p1:textColor="#5C0000"
p1:layout_height="wrap_content"
p1:id="@+id/textView4" />
<TextView
p1:textSize="22sp"
p1:text="Text"
p1:layout_width="fill_parent"
p1:layout_height="wrap_content"
p1:textColor="#00005C"
p1:id="@+id/textView5" />
<TextView
p1:textSize="22sp"
p1:text="Text"
p1:textColor="#5C0000"
p1:layout_width="fill_parent"
p1:layout_height="wrap_content"
p1:id="@+id/textView6" />
</LinearLayout>
</ScrollView>