【发布时间】:2014-05-20 09:41:13
【问题描述】:
在我的布局中有一个固定宽度的微调器(下拉列表),有些条目比微调器长,所以我希望它们在选择时自动水平滚动。
我知道你可以像这样对 textview 应用自动水平滚动:
<TextView
android:id="@+id/textView1"
android:layout_width="50dp"
android:layout_height="25dp"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="Single-line text view that scrolls automatically if the text is too long to fit in the widget" />
我尝试将相同的设置应用于我的微调器,如下所示:
<Spinner
android:id="@+id/spinner1"
android:layout_width="90dp"
android:layout_height="55"
android:ellipsize="marquee"
android:entries="@array/country_arrays"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true" />
但它不会滚动。有什么想法吗?
【问题讨论】:
标签: android scroll spinner horizontal-scrolling