我正在开发一个 AppWidget
,我需要一个 TextView
来将文本显示为选取框。我已尝试使用以下代码(就像在常规 Activity
中所做的那样),但文本不会滚动。
<TextView
android:layout_width="150dip"
android:layout_height="wrap_content"
android:text="@string/marquee_forever"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever" />
谁能告诉我如何解决这个问题?
最佳答案
您需要在 xml 中为选取框添加以下属性:
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit ="marquee_forever"
android:scrollHorizontally="true"
android:focusable="true"
android:focusableInTouchMode="true"
关于android - App Widget 上的 Marquee TextView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3854353/