选中后更改文本大小

时间:2010-10-14 13:42:37

标签: android

选择后,有没有办法增加TextView的文字大小?

1 个答案:

答案 0 :(得分:0)

这对你有帮助吗?

包com.android.sample;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class SampleActivity extends Activity {
    /** Called when the activity is first created. */
    private TextView mTextView;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        mTextView = (TextView) findViewById(R.id.textview1);
        mTextView.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // TODO Auto-generated method stub
                mTextView.setTextSize(50);
            }
        });
    }
}