2016-05-04 12 views
1

Ich habe auf this verwiesen auf meine Textansicht scrollbar, aber es scheint nicht für mich arbeiten. Was mache ich falsch? Mein Textview ist Teil eines RemoteView, wenn es überhaupt ankommt ...TextView scrollt nicht für RemoteView

Code

<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" 
      /> 
+1

Mögliche Duplikat [Get Textview von RemoteViews seine machen Text scrollbar] (https://stackoverflow.com/questions/25415828/get-textview-from-remoteviews-to-make-its-text-scrollable) –

Antwort

0

Ändern Sie Ihre Textview zu:

<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>