小编Lut*_*kin的帖子

文本切换器更新textview颜色

 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只能调用一次.那么有可能改变文本交换器的颜色吗?

android textview textswitcher

2
推荐指数
1
解决办法
592
查看次数

标签 统计

android ×1

textswitcher ×1

textview ×1