天天看點

android 如何讓appwidget 裡面設定TextView 滾動,android widget marquee text

<TextView
            android:id="@+id/title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@color/appwidget_text"
            android:textStyle="bold"
            android:textSize="18sp"
            android:singleLine="true"
            android:fadingEdge="horizontal"
            android:fadingEdgeLength="10dip"
            android:ellipsize="marquee"
            android:marqueeRepeatLimit ="marquee_forever"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:duplicateParentState="true">
            <requestFocus android:focusable="true" 
                android:focusableInTouchMode="true"
       			 android:duplicateParentState="true" />
            </TextView>
           

text要想自動滾動,首先條件是要Select = true,但是在RemoteView 裡面無法設定,是以隻能在xml裡面下功夫,主要代碼是要設定focus