2012-12-31 26 views
1

我可以在TextView中使用TextSwitcher動畫嗎? (我想在更改字符時更改它)

我可以通過代碼(如TextView : txtView.setTextSize();)和更改文本顏色來更改文本大小。TextSwitcher動畫定製

代碼的簡單

回答

0

您放置在你的代碼的上半部分的textswitcher視圖後:

TextSwitcher questionTextSwitcher = (TextSwitcher) findViewById(R.id.textSwitcher); 
    questionTextSwitcher.setFactory(new MyTextSwitcherFactory()); 

在這裏你可以操縱你的TextView:

 private class MyTextSwitcherFactory implements ViewSwitcher.ViewFactory { 
      public View makeView() { 
       TextView textView = new TextView(CurrentClass.this); 
       textView.setGravity(Gravity); 
       textView.setTextSize(size); 
       textView.setTextColor(Color); 
       } 
      }