android-theme

Cannot resolve symbol Theme, ThemeOverlay

末鹿安然 提交于 2019-12-29 06:37:27
问题 I updated my android studio to latest version - 3.0.1. Since then it complains 'Cannot resolve symbol' for Theme and ThemeOverlay in the following lines of code. App runs fine but they are marked in RED in the file. styles.xml <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"></style> <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> build.gradle is updated with

Changing Background and text color of AppCompat Light DarkActionBar Theme on android

别来无恙 提交于 2019-12-28 12:18:26
问题 I have used AppCompat Light DarkActionBar Theme for my App. <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> </style> Is it possible to change the background color and text color of this ActionBar ? If yes, how ? 回答1: The following code will allow you to completely style the action bar. <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="actionBarStyle">@style/Widget.AppTheme.ActionBar</item> <item name="actionBarTheme">@style/ThemeOverlay

Changing Background and text color of AppCompat Light DarkActionBar Theme on android

橙三吉。 提交于 2019-12-28 12:18:22
问题 I have used AppCompat Light DarkActionBar Theme for my App. <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> </style> Is it possible to change the background color and text color of this ActionBar ? If yes, how ? 回答1: The following code will allow you to completely style the action bar. <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="actionBarStyle">@style/Widget.AppTheme.ActionBar</item> <item name="actionBarTheme">@style/ThemeOverlay

What's the difference between windowBackground and background for activities style?

纵然是瞬间 提交于 2019-12-28 05:50:06
问题 I have a background set for all of the activities of the app by using the "android:background" parameter in the styles and setting the theme of the application to link to this style. All worked well, till I've noticed that for a dialog with a list of items, it makes each item to have the full size of the background . After changing the parameter being used to "android:windowBackground" it seems to work fine in this case too. Why does it occur? What is the difference between the two? Also ,

android themes - defining colours in custom themes

感情迁移 提交于 2019-12-28 02:45:26
问题 I am sure there is a simple answer to that yet I just cant find it so I throw it into stackoverflow ... ;-) I will just put it into an example. I have an android app where the user can choose the theme in the preferences - dark or light theme. Depending on the chosen theme I have to adjust 20 colors in my app. So I have the hope that I can define colours in the theme and then use the names of this so defined colours in the my TextViews etc. Yet so far I cant figure out how to do that and can

android themes - defining colours in custom themes

十年热恋 提交于 2019-12-28 02:45:09
问题 I am sure there is a simple answer to that yet I just cant find it so I throw it into stackoverflow ... ;-) I will just put it into an example. I have an android app where the user can choose the theme in the preferences - dark or light theme. Depending on the chosen theme I have to adjust 20 colors in my app. So I have the hope that I can define colours in the theme and then use the names of this so defined colours in the my TextViews etc. Yet so far I cant figure out how to do that and can

When should one use Theme.AppCompat vs ThemeOverlay.AppCompat?

本秂侑毒 提交于 2019-12-27 12:10:27
问题 There are the following Theme.AppCompat classes: Theme.AppCompat Theme.AppCompat.Light Theme.AppCompat.Light.DarkActionBar Theme.AppCompat.NoActionBar Theme.AppCompat.Light.NoActionBar Theme.AppCompat.DialogWhenLarge Theme.AppCompat.Light.DialogWhenLarge Theme.AppCompat.Dialog Theme.AppCompat.Light.Dialog Theme.AppCompat.CompactMenu and the following ThemeOverlay.AppCompat classes: ThemeOverlay.AppCompat ThemeOverlay.AppCompat.Light ThemeOverlay.AppCompat.Dark ThemeOverlay.AppCompat.ActionBar

Android black and white theme

守給你的承諾、 提交于 2019-12-26 10:46:47
问题 i am trying to achieve theme like this but i can't find any help about it i am trying to get white action bar with black icons and text and status bar with black icons and white background I am changing color pragmatically but I think there is some proper theme to get something like this i have also tried material.theme.light 回答1: Here is your Solution Try this <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk

Android black and white theme

て烟熏妆下的殇ゞ 提交于 2019-12-26 10:46:33
问题 i am trying to achieve theme like this but i can't find any help about it i am trying to get white action bar with black icons and text and status bar with black icons and white background I am changing color pragmatically but I think there is some proper theme to get something like this i have also tried material.theme.light 回答1: Here is your Solution Try this <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk

ActionBar object is returned as null

ε祈祈猫儿з 提交于 2019-12-25 17:55:59
问题 I get actionBar object below as null, and hence a NullPointerException when executing actionBar.setDisplayHomeAsUpEnabled(true) . Following is my code which is called from onResume of the Fragment. ActionBar actionBar = getActivity().getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); Followwing is the theme I apply to the activity in the onCreate: <style name="MyActionBarTheme" parent="Theme.AppCompat.Light"> <item name="actionBarStyle">@style/MyActionBar</item> <item name=