首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >TextView不能滚动显示RemoteView

TextView不能滚动显示RemoteView
EN

Stack Overflow用户
提问于 2016-05-05 03:21:11
回答 1查看 466关注 0票数 1

我曾向this咨询过让我的文本视图可滚动,但它似乎对我不起作用。我做错了什么?我的textView是RemoteView的一部分,如果这很重要的话...

代码

代码语言:javascript
复制
<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"
            />
EN

回答 1

Stack Overflow用户

发布于 2017-12-21 20:50:43

将您的TextView更改为:

代码语言:javascript
复制
<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>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37036282

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档