TextView Control Settings single-line display android:singleline="true"
Set TextView start position display ellipsis,android:ellipsize="Start"
Set scrolling properties,android:ellipsize="Marquee"
The scroll effect is called when the control has the focus
Create a new UI Package
Create a new class Focusedtextview inherit the TextView of the system
Overriding construction methods
Overriding the isfoused () method, which returns true, allows it to have the focus, actually without focus, just to deceive the android system
Copy the full path of this class, go to the layout file, replace the original TextView
Java:
PackageCom.qingguow.mobilesafe.ui;ImportAndroid.content.Context;ImportAndroid.util.AttributeSet;ImportAndroid.widget.TextView; Public classFocusedtextviewextendsTextView { PublicFocusedtextview (Context context) {Super(context); //TODO auto-generated Constructor stub } PublicFocusedtextview (Context context, AttributeSet attrs) {Super(context, attrs); //TODO auto-generated Constructor stub } PublicFocusedtextview (context context, AttributeSet attrs,intDefstyle) { Super(context, attrs, Defstyle); //TODO auto-generated Constructor stub} @Override Public BooleanisFocused () {//TODO auto-generated Method Stub return true; } }
Layout:
< Com.qingguow.mobilesafe.ui.FocusedTextView Android:singleline = "true" android:ellipsize= "marquee" android:text= "Mobile Defender welcomes you, This mobile defender software does not contain any redundant service processes and does not contain any unnecessary content of the consumed resources " android:layout_width=" Wrap_content " Android:layout_height = "Wrap_content" android:layout_margintop= "10DP"/>
Effect
[Android] Mobile defender Custom scrolling controls