我可以在TextView中使用TextSwitcher动画吗?(我想在更改字符时更改它)
或
我可以改变文本大小的代码(如TextView : txtView.setTextSize();)和改变TextColor也。
代码很简单
发布于 2012-12-31 21:52:07
将文本切换器视图放在代码的上半部分后:
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);
}
}https://stackoverflow.com/questions/14102131
复制相似问题