开发者

Color of the text in TextView changes color

开发者 https://www.devze.com 2022-12-20 09:52 出处:网络
In android, when I press on a TextView, the text changes color (from white to grey). Can you please tell me how can I disable that functionality?

In android, when I press on a TextView, the text changes color (from white to grey). Can you please tell me how can I disable that functionality?

T开发者_如何学Chank you.


The TextView gets its styling from whatever styles or themes you have set in your application. See android docs for an overview of those.

Part of the default theme is the look and feel of a widget in each of its states. A selector is used to configure the look and feel in a particular state, for example if it is enabled, or clicked.

To override the behavior you need to create a style (as described in the android doc above) and apply that style to your TextView.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号