android-styles

How to change the background color around a DialogFragment?

倾然丶 夕夏残阳落幕 提交于 2019-11-26 09:28:54
问题 I\'m building a custom DialogFragment . The dialog layout is set to my_dialog.xml , but how can I modify the color around the dialog (the transparent grey)? my_dialog.xml <RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\" android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\" android:layout_gravity=\"center\" > <TextView android:id=\"@+id/hello\" android:layout_width=\"100dp\" android:layout_height=\"100dp\" android:background=\"@android:color

Style bottom Line in Android

别来无恙 提交于 2019-11-26 08:42:31
问题 I need to create an android shape so that only the bottom has stroke (a dashed line). When I try the following, the stroke bisects the shape right through the center. Does anyone know how to get it right? the stroke needs to be the bottom line/border. I am using the shape as a background to a TextView. Please, never mind why I need it. <?xml version=\"1.0\" encoding=\"utf-8\"?> <layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\" > <item> <shape android:shape=\"rectangle\"

ActionBarSherlock stacked action bar styling issue

怎甘沉沦 提交于 2019-11-26 08:35:45
问题 I can\'t figure out why the stacked ActionBar I have implemented has a gap between the left most tab and the edge of the screen. This is not the case with the right most tab. I tried to remove the dividers by styling the ActionBar . After playing around with styles for a little bit, it seems like I am able to override attributes of the TabView style but not the TabBar style of ActionBarSherlock . <style name=\"ActionBarTabBarStyle.Dark\" parent=\"@style/Widget.Sherlock.ActionBar.TabBar\">

Custom attributes in styles.xml

十年热恋 提交于 2019-11-26 07:23:42
问题 I have created a custom widget, and I\'m declaring it in layout.xml. I have also added some custom attributes in attr.xml. However, when trying to declare these attributes in a style in styles.xml, it\'s giving me No resource found that matches the given name: attr \'custom:attribute\'. I have put the xmlns:custom=\"http://schemas.android.com/apk/res/com.my.package\" in all of the tags in styles.xml, including <?xml> , <resources> , and <style> , but it still gives me the same error, that it

How to make a smaller RatingBar?

佐手、 提交于 2019-11-26 06:53:40
问题 I\'ve added a RatingBar in a layout: <RatingBar android:id=\"@+id/ratingbar\" android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\" android:numStars=\"5\" android:stepSize=\"1.0\" /> But the default style for the rating bar is too large. I\'ve try to change it by adding the android style : style=\"?android:attr/ratingBarStyleSmall\" But the result is too small and it\'s impossible to set a rate with this property. How could I do? 回答1: The default RatingBar widget is

How to change focus color of EditText in Android

无人久伴 提交于 2019-11-26 06:30:01
问题 How can I change the focus color (orange) on an EditText box? The focus color is a small rim around the entire control and is bright orange when the control has focus. How can I change the color of that focus to a different color? 回答1: You'll have to create/modify your own NinePatch image to replace the default one, and use that as the background of your EditText. If you look in your SDK folder, under your platform, then res/drawable, you should find the NinePatch image for the EditText focus

How to custom switch button?

可紊 提交于 2019-11-26 04:07:32
问题 I am looking to Custom The Switch Button to becoming as following : How to achieve this ? 回答1: you can use the following code to change color and text : <org.jraf.android.backport.switchwidget.Switch android:id="@+id/th" android:layout_width="match_parent" android:layout_height="wrap_content" app:thumb="@drawable/apptheme_switch_inner_holo_light" app:track="@drawable/apptheme_switch_track_holo_light" app:textOn="@string/switch_yes" app:textOff="@string/switch_no" android:textColor="#000000" /

Question mark (?) in XML attributes for Android

醉酒当歌 提交于 2019-11-26 03:49:54
问题 Can anyone explain the question mark means in Android XML attributes? <TextView style=\"?android:attr/windowTitleStyle\" More attributes /> 回答1: The question mark means it's a reference to a resource value in the currently applied theme. See the linuxtopia Android Dev Guide or the android.com Dev Guide for more about it. \? escapes the question mark. 回答2: The ? lets you refer to a style attribute instead of a specific hard-coded resource . See "Referencing style attributes" in the Android Dev

Android statusbar icons color

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 02:18:56
问题 I was wondering if it\'s possible to change the statusbar icons colour ( not the statusbar colour, colorPrimaryDark ) Let\'s say I want this statusbar with: <item name=\"colorPrimaryDark\">@android:color/white</item> and the icons in black, is it possible? Thanks. EDIT: New in the M developer preview: windowLightStatusBar. Flipping this on in your theme tells the system to use a dark foreground, useful for lighter colored status bars. Note the M preview seems to have a bug where notification

Changing EditText bottom line color with appcompat v7

假装没事ソ 提交于 2019-11-26 00:35:07
问题 I am using appcompat v7 to get the look consistent on Android 5 and less. It works rather well. However I cannot figure out how to change the bottom line color and the accent color for EditTexts. Is it possible? I have tried to define a custom android:editTextStyle (cf. below) but I only succeeded to change the full background color or text color but not the bottom line nor the accent color. Is there a specific property value to use? do I have to use a custom drawable image through the