我该如何申请一个样式编程? [英] How do I apply a style programmatically?

查看:97
本文介绍了我该如何申请一个样式编程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个风格被称为红色和绿色,我有一个,如果说明书,找出哪些申请,但我不知道code实际上从Java应用样式。

I have a styles called Red and Green and I have an if statment to find out which to apply, but I don't know the code to actually apply a style from the java.

推荐答案

我发现这是唯一能够建立在Java内的视图时完成。如果是前手在XML定义的,你不能动态地改变风格。

I found out this is only able to be done when creating an View from inside the Java. If it is defined in the XML before hand you cannot dynamically change the style.

这篇关于我该如何申请一个样式编程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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