Lut*_*kin 2 android textview textswitcher
private ViewSwitcher.ViewFactory mFactory = new ViewSwitcher.ViewFactory() {
@Override
public View makeView() {
TextView t = new TextView(getActivity());
t.setTextColor(nptrackcolor); //global int variable
t.setMaxLines(2);
t.setMinLines(2);
TextViewCompat.setTextAppearance(t,R.style.NowPlayingTextAppereance);
return t;
}
};
Run Code Online (Sandbox Code Playgroud)
今天我尝试使用textswitcher来更新现在在我的应用程序中使用淡入/淡出动画播放标题.它切换文本但不切换颜色.我意识到setFactory只能调用一次.那么有可能改变文本交换器的颜色吗?
我找到了解决方案
((TextView)textSwitcher.getNextView()).setTextColor(nptrackcolor);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
592 次 |
| 最近记录: |