Android seekBar和文本切换器
使用textview,我可以使用此代码更改文本大小。现在我用textswitcher更改了textview,我不能用“setTextSize”。应该使用哪种方法Android seekBar和文本切换器,android,Android,使用textview,我可以使用此代码更改文本大小。现在我用textswitcher更改了textview,我不能用“setTextSize”。应该使用哪种方法 mSwitcher = (TextSwitcher) findViewById(R.id.switcher); mSwitcher.setFactory(this); Animation in = AnimationUtils.loadAnimation(this, android.
mSwitcher = (TextSwitcher) findViewById(R.id.switcher);
mSwitcher.setFactory(this);
Animation in = AnimationUtils.loadAnimation(this,
android.R.anim.fade_in);
Animation out = AnimationUtils.loadAnimation(this,
android.R.anim.fade_out);
mSwitcher.setInAnimation(in);
mSwitcher.setOutAnimation(out);
seekBar1.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
public void onStopTrackingTouch(SeekBar seekBar) {
[...]
seek=10;
seekBar1.setProgress(seek);
// textView1.setTextSize(seek);
I've a public View makeView() {
TextView t = new TextView(this);
t.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL);
t.setTextSize(seek);
return t;
}
你可以用
mSwitcher = (TextSwitcher) findViewById(R.id.switcher);
mSwitcher.setFactory(this);
TextView t1 = (TextView) mSwitcher.getChildAt(0);
public View makeView() {
TextView t = new TextView(this);
t.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL);
t.setTextSize(36);
return t;
}
你可以用
mSwitcher = (TextSwitcher) findViewById(R.id.switcher);
mSwitcher.setFactory(this);
TextView t1 = (TextView) mSwitcher.getChildAt(0);
public View makeView() {
TextView t = new TextView(this);
t.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL);
t.setTextSize(36);
return t;
}
谢谢工作!:-)一个问题:现在我有一个文本是正确的,下一个文本是不可见的,另一个文本是正确的,下一个文本是不可见的。我更新了我的代码。谢谢!工作!:-)一个问题:现在我有一个文本是正确的,下一个文本是不可见的,另一个文本是正确的,下一个文本是不可见的。我更新了我的代码。