The default is the following attribute added in TextView: android:ellipsize= "marquee" android:focusableintouchmode= "true" android:gravity= " Center " android:marqueerepeatlimit=" Marquee_forever " android:scrollhorizontally=" true " Android: Singleline= "true"
But you will find it invalid, and the GridView is not clickable, only the custom TextView code is as follows:
Package Com.shangc.mycar.custom;import Android.content.context;import Android.util.attributeset;import android.widget.textview;/** * Custom TextView implementation in the GridView to achieve the effect of the marquee, the isfocused () method in the replication view, the default is not effective, * And the GridView is not clickable * * @author Dennis * */public class Mygridviewtextview extends Textview{public Mygridviewtextview ( Context context, AttributeSet attrs, int defstyle) {Super (context, attrs, defstyle);//TODO Auto-generated constructor Stu B}public Mygridviewtextview (Context context, AttributeSet Attrs) {Super (context, attrs);} @Overridepublic Boolean isFocused () {return true;}} Use the custom TextView above and remove the android:focusable= "true".