为什么直接出错,我用的是AS。。
<com.example.saihor.qaq.test.MarqueeText
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="@string/text_"
/>
<com.example.saihor.qaq.test.MarqueeText
android:layout_marginTop="62dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="@string/text_"
android:layout_below="@+id/text"
android:id="@+id/text2" />
/**
*
**/
package com.example.saihor.qaq.test;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;
import java.util.jar.Attributes;
/**
* Created by SaiHor on 2015/7/28.
*/
public class MarqueeText extends TextView {
public MarqueeText(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public MarqueeText(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MarqueeText(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
public MarqueeText(Context context) {
super(context);
}
public boolean isFocused()
{
return true;
}
}