【问题标题】:TextSwitcher Animation CustomizationTextSwitcher 动画定制
【发布时间】:2012-12-31 22:19:11
【问题描述】:

我可以将 TextSwitcher 动画与 TextView 一起使用吗? (我想在 Char 更改时更改它)
或者
我可以通过代码更改文本大小(如TextView : txtView.setTextSize();)并更改TextColor。

代码很简单

【问题讨论】:

    标签: android animation textview


    【解决方案1】:

    将文本切换器视图放在代码的上部之后:

        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);
                    }
                }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-02-13
      • 2011-03-09
      • 1970-01-01
      • 2017-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多