我可以将 TextSwitcher 动画与 TextView 一起使用吗?(我想在 Char 更改时更改它)
或者
我可以通过代码(如TextView : txtView.setTextSize();
)更改文本大小并更改 TextColor。
代码很简单
将 textswitcher 视图放在代码的上部后:
TextSwitcher questionTextSwitcher = (TextSwitcher) findViewById(R.id.textSwitcher);
questionTextSwitcher.setFactory(new MyTextSwitcherFactory());
在这里你可以操纵你的文本视图:
private class MyTextSwitcherFactory implements ViewSwitcher.ViewFactory {
public View makeView() {
TextView textView = new TextView(CurrentClass.this);
textView.setGravity(Gravity);
textView.setTextSize(size);
textView.setTextColor(Color);
}
}