我正忙于一个水平滚动视图,里面有一个文本视图。我无法让 textview 能够在没有任何空间的情况下从一侧滑到另一侧。
如果我只是添加 textview 它不能滑动。
基本上我想要的是一个水平滚动视图,中间有一个文本视图,可以向左或向右滚动但不能过度滚动(仍然可见)
eg: | Text | |Text | | Text| But not |ext | | Te|
我当前的布局如下所示:
<HorizontalScrollView
android:layout_width="250dp"
android:layout_height="35dp"
android:scrollbars="none" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="36dp" >
<Space
android:layout_width="125dp"
android:layout_height="wrap_content"
android:background="#808080" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TEST"
android:textSize="30dp" />
<Space
android:layout_width="125dp"
android:layout_height="wrap_content"
android:background="#808080" />
</LinearLayout>
</HorizontalScrollView>