Java code
<? Xml version = "1.0" encoding = "UTF-8"?>
<AbsoluteLayout
Android: id = "@ + id/widget35"
Android: layout_width = "fill_parent"
Android: layout_height = "fill_parent"
Xmlns: android = "http://schemas.android.com/apk/res/android"
>
<TextView
Android: id = "@ + id/t1"
Android: layout_width = "100px"
Android: layout_height = "wrap_content"
Android: text = "str_id"
Android: layout_x = "61px"
Android: layout_y = "69px"
Android: scrollX = "2px"
Android: singleLine = "true"
Android: ellipsize = "marquee"
Android: marqueeRepeatLimit = "marquee_forever"
>
</TextView>
<ViewStub
Android: layout_y = "221dip"
Android: layout_width = "wrap_content"
Android: layout_x = "103dip"
Android: id = "@ + id/ViewStub01"
Android: layout_height = "wrap_content"
/>
</AbsoluteLayout>
Activity. java:
Java code
Public class Test extends Activity {
Private TextView text;
Public void onCreate (Bundle savedInstanceState ){
Super. onCreate (savedInstanceState );
SetContentView (R. layout. main );
Text = (TextView) findViewById (R. id. t1 );
Text. setText ("happiness means cats eat fish, dogs chew on bones, and Altman beats monsters! ");
Text. setTextSize (30 );
// Text. setHorizontallyScrolling (true );
Text. setFocusable (true );
}
}
As follows: