android-styles

Set style on TableRow in Android

♀尐吖头ヾ 提交于 2019-12-01 00:40:36
问题 Using the Android SDK, there doesn't seem to be any way to set the style on a table row. I want to do the equivalent of: <TableRow style='@style/TableRow_classic' > in code. I would like something like: TableRow row = new TableRow(this); row.setStyle(R.style.TableRow_classic); Does anyone know how to find this? 回答1: The best solution I've found to accomplish this is to create a "partial" layout representing the table row, with a style defined: <?xml version="1.0" encoding="utf-8"?> <TableRow

Change the height of the action bar overflow menu items via styles

匆匆过客 提交于 2019-11-30 23:29:52
We are working on an Android application for industrial uses. We have increased the size of the action bar, text, etc to help improve visibility and touch target size. Everything works well, however I have been unable to increase the height of the action bar overflow menu's list items: Digging around I have been able to change the background colour of the popup menu using <style name="MyTheme" parent="@android:style/Theme.Holo"> <item name="android:popupMenuStyle">@style/MyPopupMenu</item> </style> <style name="MyPopupMenu" parent="android:style/Widget.Holo.ListPopupWindow"> <item name=

Change the height of the action bar overflow menu items via styles

旧巷老猫 提交于 2019-11-30 18:06:04
问题 We are working on an Android application for industrial uses. We have increased the size of the action bar, text, etc to help improve visibility and touch target size. Everything works well, however I have been unable to increase the height of the action bar overflow menu's list items: Digging around I have been able to change the background colour of the popup menu using <style name="MyTheme" parent="@android:style/Theme.Holo"> <item name="android:popupMenuStyle">@style/MyPopupMenu</item> <

Android Google plus login button style

家住魔仙堡 提交于 2019-11-30 13:55:15
I need the long style button for google+ signin in android. According to the Branding guidelines here there are different styles for the button like long, medium, short etc I am getting the medium style button with help of the sample app, But I want the long style button. here is my button ` <com.google.android.gms.common.SignInButton android:id="@+id/sign_in_button" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="5dp" android:visibility="visible" /> ` As the website described there are 3 sized button Icon only = SignInButton.SIZE_ICON_ONLY

Full Screen in customize theme

懵懂的女人 提交于 2019-11-30 13:08:39
问题 I need my app to show as full screen. Now I know how to add this feature into the application tag in Mainfest using android:theme=”@android:style/Theme.NoTitleBar.Fullscreen" However, I have my own theme called "CodeFont", and I cannot use two themes in the same application. How I can add this feature into my own style tag in my resources file? There is no such things as an android:style tag. 回答1: Create your custom theme by using default theme, like this window with Fullscreen <style name=

EditText how to activate copy/paste popup without any actionbar?

大城市里の小女人 提交于 2019-11-30 07:53:42
问题 I m under delphi and i use the android framework to create an edit. When i set the theme to Theme.DeviceDefault.Light.NoActionBar then i can select some text in my EditText and i have a popup with "select all/cut/copy/paste/etc" like you can see on the picture below. However, when i select Theme.Material.Light.NoActionBar or Theme.Holo.Light.NoActionBar then i can't select any text in my EditText (i have no right or left text selection handles) and off course i don't have any copy/paste popup

How to pass AttributeSet when creating view programmatically in android

非 Y 不嫁゛ 提交于 2019-11-30 07:19:13
问题 I create programmatically like horizontalview then, how to pass AttributeSet in programmatically. My constructor looks like this: public HorizontalListView(Context context, AttributeSet attrs) { super(context, attrs); } I have try this: mHlvSimpleList= new HorizontalListView(mcontext,R.style.niceview); Error: The constructor HorizontalListView(Context, int) is undefined in style.xml <style name="niceview"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height

How to set Style for a button in Android?

纵饮孤独 提交于 2019-11-30 07:06:27
问题 I have defined the below files in res folder. styles_apptheme.xml <?xml version="1.0" encoding="utf-8"?> <!-- Generated with http://android-holo-colors.com --> <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="ButtonAppTheme" parent="android:Widget.Holo.Light.Button"> <item name="android:background">@drawable/apptheme_btn_default_holo_light</item> </style> </resources> themes_apptheme.xml <?xml version="1.0" encoding="utf-8"?> <!-- Generated with http:/

Android Layout - when to use app: vs android:?

安稳与你 提交于 2019-11-30 05:15:39
I've been writing some Android apps but I don't really understand when to use app: and when to use android: . When styles are not being applied the way they're supposed to, I use trial and error and sometimes find that using app: instead of android: solves the issue but I don't understand why. It'd be great if someone could point me in the right direction. Thanks! You are talking about custom namespace.In android we can create custom views in additional to already available views. As per in Google developer docs.. To add a built-in View to your user interface, you specify it in an XML element

Dark actionbar with white dropdown menu from Holo Light

大兔子大兔子 提交于 2019-11-30 04:53:37
I've got an custom theme with a parent @android:style/Theme.Holo.Light.DarkActionBar I want to change the dropdown menu into the white version (see image) I have looked up some examples, but they didn't work out for me, is it possible to just override the dropdown menu from the DarkActionBar with the light version? (I dont use the sherlock actionbar) This worked for me. Hope it help: <style name="YOUR_DARK_AB_THEME"> <item name="android:actionBarWidgetTheme">@style/YourActionBarWidget</item> </style> <!-- This helps the PopupMenu stick with Light theme while the ActionBar is in Dark theme -->