我TextView动态创建8 秒并在我的布局中添加它们.我想设置他们的文字颜色.所以我在color.xml中声明了颜色代码,我将其设置为:
txt1.setTextColor(getResources().getColor(R.color.off_white));
Run Code Online (Sandbox Code Playgroud)
但我必须多余地为所有人TextView单独做这件事.有没有办法我可以为所有TextView全局设置它.类似于我们在jQuery中可以做的事情,例如:
$('input[type="text"]').css('color','white');
Run Code Online (Sandbox Code Playgroud)