選取框工作不適合我的TextView請檢查下面的代碼的Android TextView的跑馬燈不工作
XML代碼爲TextView
<TextView
android:id="@+id/mtextcash"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="30dp"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:gravity="center"
android:marqueeRepeatLimit="marquee_forever"
android:maxLength="5"
android:scrollHorizontally="true"
android:scrollbars="horizontal"
android:singleLine="true"
android:text="Simple application that shows how to use marquee, with a long text"
android:textColor="@color/white"
android:textColorHint="@color/white"
android:textSize="25dp" />
在活動的OnCreate
TextView inputAvailableCash = (TextView) findViewById(R.id.mtextcash);
inputAvailableCash.setSelected(true);
謝謝預先
問題在於你的android:layout_width值是wrap_content。檢查readyandroid答案。 –
可能的重複http://stackoverflow.com/questions/10458844/textview-marquee-doesnt-work?rq=1或http://stackoverflow.com/questions/24165143/textview-with-marquee-is-not-工作?rq = 1 –