<分区>
public class Crunk extends Activity {
TextView textView = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_crunk);
Button button = null;
button = (Button)findViewById(R.id.button1);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Log.e("It's Clicked", "Don't Worry");
textView.setText("SeeMe");
textView.setEllipsize(TruncateAt.MARQUEE);
}
});
textView = (TextView)this.findViewById(R.id.textView1);
textView.setSelected(true);
textView.setText("Waitin'....");
}
此代码仅显示文本,不显示字幕效果。
帮我弄出效果。
我希望文本在点击按钮时显示效果。
尝试了大部分方法还是得不到想要的效果....
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="180dp"
android:text="@string/TapMe" />
<TextView
android:text="@string/SeeMe"
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="51dp"
android:textAppearance="?android:attr/textAppearanceLarge" />