public class TextViewMarquee extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.textview);
findViewById(R.id.widget28).setSelected(true);
}
} <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent">
<TextView android:id="@+id/widget28" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:singleLine="true" android:ellipsize="marquee" android:fadingEdge="horizontal" android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally="true" android:textColor="#ff4500" android:text="Simple application that shows how to use RelativeLayout" />
</RelativeLayout>
标签:findViewById,layout,setContentView,Marquee,widget28,savedInstanceState,onCreate
From: https://blog.51cto.com/u_16166892/6525370