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

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

问题描述

我是编程方式创建,设置样式为的TextView 其中。

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

我如何实施风格=@风格/测试编程?

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

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

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

推荐答案

目前不支持动态样式的变化。您必须设置样式之前的观点是创建(XML格式)。

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

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

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