如何在Android中以编程方式设置样式属性? [英] how to set the Style Attribute Programmatically in Android?

查看:133
本文介绍了如何在Android中以编程方式设置样式属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须以编程方式创建 TextView 的样式。



如何以编程方式实现 style =@ style / test / p>

我看过 Android开发人员风格文档,但它没有回答我的问题。任何想法?

解决方案

目前不支持动态样式更改。您必须在创建视图之前设置样式(在xml中)。


I have to set the style for a TextView which is created programmatically.

How do I implement style="@style/test" programmatically?

I have looked at the Android developer style documentation already, but it did not answer my question. Any ideas?

解决方案

Dynamic style change is not currently supported. You must set the style before the view is create (in xml).

这篇关于如何在Android中以编程方式设置样式属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆