Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/184.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android seekBar和文本切换器_Android - Fatal编程技术网

Android seekBar和文本切换器

Android seekBar和文本切换器,android,Android,使用textview,我可以使用此代码更改文本大小。现在我用textswitcher更改了textview,我不能用“setTextSize”。应该使用哪种方法 mSwitcher = (TextSwitcher) findViewById(R.id.switcher); mSwitcher.setFactory(this); Animation in = AnimationUtils.loadAnimation(this, android.

使用textview,我可以使用此代码更改文本大小。现在我用textswitcher更改了textview,我不能用“setTextSize”。应该使用哪种方法

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;
  } 
谢谢工作!:-)一个问题:现在我有一个文本是正确的,下一个文本是不可见的,另一个文本是正确的,下一个文本是不可见的。我更新了我的代码。谢谢!工作!:-)一个问题:现在我有一个文本是正确的,下一个文本是不可见的,另一个文本是正确的,下一个文本是不可见的。我更新了我的代码。