android-text-color

Android Drawable color runtime

旧城冷巷雨未停 提交于 2021-02-11 12:15:46
问题 I am developing an android app. I have two different text view with different text view as shown in below two images: Text view one: Text view Two: I have a question, should I create two different drawable files with different colors or should I create a single drawable file and change the color runtime? What's the standard way to achieve this? If I should create a single drawable file then how should I change to color programmatically? 回答1: try this simple example public class MainActivity

Android Tab Text color [duplicate]

蹲街弑〆低调 提交于 2020-01-12 07:55:10
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Android: Change Tab Text Color Programmatically How can we change the text color in android tab. 回答1: You can use following code TabHost tabHost = getTabHost(); for(int i=0;i<tabhost.getTabWidget().getChildCount();i++) { TextView tv = (TextView) tabhost.getTabWidget().getChildAt(i).findViewById(android.R.id.title); //Unselected Tabs tv.setTextColor(Color.parseColor("#ffffff")); } TextView tv = (TextView) tabhost

Custom unselected tab text color in SlidingTabLayout

泪湿孤枕 提交于 2019-12-21 20:27:08
问题 I am using the SlidingTabLayout class to display tabs in my Android application. I'm using my custom tab view which I set with the setCustomTabView function. Although I can easily customize the selected tab text color, I can not find a way to customize the text color of the unselected tab. In the L preview documentation they suggest that it should be #fff 60%, and I want to use that exact same value also. I looked at the SlidingTabLayout and SlidingTabStrip classes, but could not figure out

Custom unselected tab text color in SlidingTabLayout

房东的猫 提交于 2019-12-04 14:00:01
I am using the SlidingTabLayout class to display tabs in my Android application. I'm using my custom tab view which I set with the setCustomTabView function. Although I can easily customize the selected tab text color, I can not find a way to customize the text color of the unselected tab. In the L preview documentation they suggest that it should be #fff 60%, and I want to use that exact same value also. I looked at the SlidingTabLayout and SlidingTabStrip classes, but could not figure out where should I make modifications. Sandra The answer turned out to be quite simple, actually.. I don't

Android Tab Text color [duplicate]

落花浮王杯 提交于 2019-12-03 15:00:17
This question already has answers here : Possible Duplicate: Android: Change Tab Text Color Programmatically How can we change the text color in android tab. You can use following code TabHost tabHost = getTabHost(); for(int i=0;i<tabhost.getTabWidget().getChildCount();i++) { TextView tv = (TextView) tabhost.getTabWidget().getChildAt(i).findViewById(android.R.id.title); //Unselected Tabs tv.setTextColor(Color.parseColor("#ffffff")); } TextView tv = (TextView) tabhost.getCurrentTabView().findViewById(android.R.id.title); //for Selected Tab tv.setTextColor(Color.parseColor("#000000")) I use the

selector with spanable not working on android M but working fine on below M

时间秒杀一切 提交于 2019-12-02 18:26:29
问题 I am creating a selector with spannable string of textview with the help of this stackoverflow link (Change the text color of a single ClickableSpan when pressed without affecting other ClickableSpans in the same TextView), it is working fine on all android version except android-M, i am not able to detect why, so please assist me guys. Basically my view is like this one, https://drive.google.com/file/d/0BwkVxZWl7VcEVkFTQVRNbE9sLTA/view?usp=sharing, i want a selector on Register Now, but that

setHintTextColor() in EditText

白昼怎懂夜的黑 提交于 2019-11-27 07:09:20
I have View in which there are two text boxes, and the user can select text color from another view on the same screen (through dialog box). So when the user changes color via dialog box, I am changing color of EditText text and its hint. But when there is some text is available in EditText after that user selects other color, then that text is coming in that color. But if I remove all that text then the color of HintText is that of the previous color. For example, currently if I have red color in text box and the user selects green color so text is there in green color. But if I remove that

setHintTextColor() in EditText

元气小坏坏 提交于 2019-11-26 13:04:21
问题 I have View in which there are two text boxes, and the user can select text color from another view on the same screen (through dialog box). So when the user changes color via dialog box, I am changing color of EditText text and its hint. But when there is some text is available in EditText after that user selects other color, then that text is coming in that color. But if I remove all that text then the color of HintText is that of the previous color. For example, currently if I have red

ActionBar text color

可紊 提交于 2019-11-25 22:44:34
问题 how can I change the text color of the ActionBar? I\'ve inherited the Holo Light Theme, I\'m able to change the background of the ActionBar but I don\'t find out what is the attribute to tweak to change the text color. Ok, I\'m able to change the text color with the attribute android:textColorPrimary but it also changes the text color of the dropdown menu displayed when an overflow happen on the ActionBar buttons. Any idea how to change the color of those dropdown menu / List ? 回答1: Ok, I've