android-styles

How to change the Action bar text and background properties?

别来无恙 提交于 2019-12-12 11:23:40
问题 Here is my style for the action bar. I would like to change the text and background properties. But the changes are not being applied to the app. Where am I making mistake? This is my style.xml <style name="AppTheme" parent="@android:style/Theme.Holo.Light"> <item name="android:actionBarStyle">@style/MyActionBar</item> </style> <style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar"> <item name="android:windowBackground">@color/white</item> <item name="android:background

Centering CheckBox Views

守給你的承諾、 提交于 2019-12-12 10:58:21
问题 If you're interested in RadioButtons in addition to (or instead of) CheckBoxes, see this question instead. Despite the presence of <item name="android:layout_gravity">center_horizontal</item> in the style file, the two checkboxes are not centered, but appear "left-justified". res/layout/activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/MyLL" android:layout_width="fill_parent" android:layout_height

Changing the text appearance in styles and themes for an Android app

眉间皱痕 提交于 2019-12-12 08:17:50
问题 I am writing an android app and I am wanting to alter the theme of my app. I have managed to alter the background colour of the app by using a theme, but I am struggling to change the default text appearance. This is my styles.xml resource file. <resources> <style name="QTheme" parent="android:Theme.Light"> <item name="android:windowBackground">@color/q_green</item> <item name="android:colorBackground">@color/q_green</item> <item name="android:textAppearance">@style/QText</item> </style>

Android color of back arrow, menu text color and component default colors

人走茶凉 提交于 2019-12-12 06:06:45
问题 I've been struggling to change the colors of some components with styles but seems every property affects another. Here's the styles that I'm using Color.xml <?xml version="1.0" encoding="utf-8"?> <resources> <color name="colorPrimary">@color/blue</color> <color name="colorPrimaryDark">@color/blue</color> <color name="colorAccent">@color/blue</color> <color name="blue">#032C60</color> <color name="grey">#e1e0e0</color> </resources> styles.xml <resources> <!-- Base application theme. -->

How can I achieve this theme with AppCompat?

ⅰ亾dé卋堺 提交于 2019-12-12 04:25:49
问题 I am trying to create this theme for one, and just one of my activities: Since I am learning how this styles work, and I am now beginning to be aware that we have more different & incompatible ways of styling in android than atoms in the whole universe. So I've tried to learn from this site: http://jgilfelt.github.io/android-actionbarstylegenerator However when I try to apply its theme in my project that is using AppCompat I get the java.lang.IllegalStateException: You need to use a Theme

Default Style Resource pre API Level 21

佐手、 提交于 2019-12-12 04:23:37
问题 I am looking to create a custom ViewGroup to be used in a library; which contains a few ImageButton objects. I would like to be able to apply a style each ImageButton ; but I cannot figure out how to apply a style programmatically other than by applying a attribute resource to the defStyleAttr parameter; like so: mImageButton = new ImageButton( getContext(), // context null, // attrs R.attr.customImageButtonStyle); // defStyleAttr The issue with this is that the only way to change the style

Override certain attributes of a custom control

谁都会走 提交于 2019-12-12 01:28:48
问题 Let's say there's a custom control and related style in an Android library project. The application that uses this library wants to override certain attributes of that control, while inheriting the others. In my current approach, I have the following code: In library/styles.xml: <style name="CreditCardInputField"> <item name="android:layout_margin">10dp</item> <item name="android:background">@drawable/border</item> <item name="android:textStyle">bold|italic</item> </style> In app/styles.xml:

How to resize actionbar tabs

老子叫甜甜 提交于 2019-12-12 00:42:19
问题 I looked all stackoverflow's topics about it, and none of these solutions - like this one: <style name="Widget.Holo.Tab" parent="@android:style/Widget.Holo.Light.ActionBar.TabView"> <item name="android:height">#dp</item> </style> <style name="Your.Theme" parent="@android:style/Theme.Holo.Light"> <item name="android:actionBarTabStyle">@style/Widget.Holo.Tab</item> </style> http://stackoverflow.com/questions/9286638/actionbar-tabs-height that changed nothing - (none of these) helped me. I have

Change homeAsUpIndicator dynamically

北城余情 提交于 2019-12-12 00:28:33
问题 I build an app with four tabs and, as a consequence, four fragments. In the first fragment, I have a sliding menu and I throw with a custom icon in the actionbar. The problem is that in the others fragments, I want to stablish other custom icon to return to the first fragment but I don't know what to do... This is my styles.xml with my custom icon for the sliding menu: <!-- Application theme. --> <style name="AppTheme" parent="AppBaseTheme"> <item name="android:homeAsUpIndicator">@drawable

How to get the font face size and formatting of a native element in Android application?

只愿长相守 提交于 2019-12-11 20:09:20
问题 I would like to reuse the exact same font-face etc... like Android uses in the PreferenceScreen Here is a screenshot I am looking to reuse the title, and the summary style from these views. alt text http://www.eyeonweb.com/android/images/l2.png 回答1: You can use system-defined text appearances like android:textAppearance="?android:attr/textAppearanceLarge (also Small, Medium). For more on these system-defined attributes, see: http://developer.android.com/reference/android/R.attr.html There's