在早于14的API中,TextView.setAllCaps()等效?

san*_*one 1 android textview uppercase

TextView.setAllCaps()从API 14开始.它与旧API(例如13和更低版本)的等价物是什么?

我在较低的API上找不到这样的方法.也许setTransformationMethod()对旧版API负责吗?如果是,我应该如何使用它?TextView.setTransformationMethod(new TransformationMethod() {...有点混乱.

Art*_*iyk 5

试试这个:

textView.setText(textToBeSet.toUpperCase());
Run Code Online (Sandbox Code Playgroud)