【问题标题】:TextView not scrolling for RemoteViewTextView 不为 RemoteView 滚动
【发布时间】:2016-05-04 19:21:11
【问题描述】:

我已经参考this 让我的文本视图可滚动,但它似乎对我不起作用。我究竟做错了什么?我的 textView 是 RemoteView 的一部分,如果这很重要的话...

代码

<TextView
            android:ellipsize="marquee"
            android:scrollHorizontally="true"
            android:textColor="@color/black"
            android:layout_gravity="left"
            android:id="@+id/status_bar_track_name"
            android:focusable="true"
            android:fadingEdge="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:singleLine="true"
            />

【问题讨论】:

标签: android xml scroll textview remoteview


【解决方案1】:

将您的 TextView 更改为:

<TextView
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:maxLines="1"
  android:duplicateParentState="true"
  android:ellipsize="marquee"
  android:marqueeRepeatLimit="marquee_forever"
  android:fadingEdge="horizontal"
  android:focusable="true"
  android:focusableInTouchMode="true"
  android:freezesText="true"
  android:scrollHorizontally="false"
  android:singleLine="true"
  >
        <requestFocus android:duplicateParentState="true"
             android:focusable="true"
             android:focusableInTouchMode="true" />
  </TextView>

【讨论】:

    猜你喜欢
    • 2018-11-13
    • 2016-11-03
    • 1970-01-01
    • 1970-01-01
    • 2012-04-08
    • 2023-04-05
    • 2017-12-21
    • 1970-01-01
    相关资源
    最近更新 更多