如何两种不同样式应用到一个元素的机器人? [英] How to apply two different styles to one element in android?

查看:104
本文介绍了如何两种不同样式应用到一个元素的机器人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个TextView,我想申请我用所有的TextView元素与另一种风格,我只是一个特定的活动中使用样式。是否有可能做到这一点?

I have a TextView and I want to apply a Style which I use for all TextView elements plus another style which I only use within a specific Activity. Is there any possibility to do that?

推荐答案

Android的下一个样式可以有一个父样式。

A style under Android can have a parent style.

所以才有 MyActivityTextView 定义 GeneralTextView 父样式,改变/添加样式属性。

So just have MyActivityTextView define GeneralTextView as parent style, and change/add style properties.

然后你可以用 MyActivityTextView 的一些看法和 GeneralTextView 其他的人。

Then you can use MyActivityTextView for some views and GeneralTextView for the others.

这在定义样式的真实描述。

这篇关于如何两种不同样式应用到一个元素的机器人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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