在androidstudio中不能实现,求大神解答
package com.example.hxq.firstapp;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;
/**
* Created by hxq on 2016/11/25.
*/
public class MarqueeText extends TextView {
public MarqueeText(Context context) {
super(context);
}
public MarqueeText(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MarqueeText(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
public boolean isFocused() {
return true;
}
}
<com.example.hxq.firstapp.MarqueeText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ta说:不乱于心,不困于情,不念过往,不惧将来!!!"
android:textSize="20dp"
android:maxLines="1"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:id="@+id/textView2"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />