android-xml

android expandablelistview how to set space between groups items

*爱你&永不变心* 提交于 2019-11-30 13:25:56
问题 I have expandablelistview and I want to add padding (or margin) between the groups items, I used margin-botton on the group items, it works but now it is also applied to the group item and its childs, I want to keep a space between groups items, not between a group item and its child, i work like this: main xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"

Programmatically change color of shape in layer list

时光总嘲笑我的痴心妄想 提交于 2019-11-30 12:32:11
问题 How can I programmatically change the color ( #000000 ) of a shape in a layer list? Here is my layer list: <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <solid android:color="#000000" /> // CHANGE THIS COLOR </shape> </item> <item android:left="5dp"> <shape android:shape="rectangle"> <solid android:color="@color/bg" /> </shape> </item> </layer-list> 回答1: First of all you need to assign id to you layer-list item. <layer-list

dpi value of default “large”, “medium” and “small” text views android

此生再无相见时 提交于 2019-11-30 10:04:27
问题 Does the documentation ( or anyone) talks about the dpi values of the default Large TextView { android:textAppearance="?android:attr/textAppearanceLarge" } Medium TextView { android:textAppearance="?android:attr/textAppearanceMedium" } Small TextView { android:textAppearance="?android:attr/textAppearanceSmall" } widgets in the SDK ? To put it in another way, can we replicate the appearance of these text views without using the android:textAppearance attribute? 回答1: See in the android sdk

Are there any side-effects of using multiple string.xml files?

南笙酒味 提交于 2019-11-30 07:51:17
I am currently creating an application that have some strings (>300 for now) and I have some problems to quickly find a string with so many of them. So I was considering the possibility of using several string.xml files instead of only one (string_menu, string_activity1, ...). Is there any side-effect with this practice? Is it a bad or a good practice? I ask this because it seems that no many people on the net are using this possibility. So maybe there is some problem with it? As stated in the documentation you can use whatever filename you want: The filename is arbitrary. The <string> element

How to change the height of the 'Log in with Facebook' button?

我的未来我决定 提交于 2019-11-30 07:48:54
I already tried several answers I could find but none of them worked with the latest Facebook Android SDK version 4.0. How can I change the layout height with the latest SDK? Just set paddingTop and paddingBottom. It works for me. <com.facebook.login.widget.LoginButton android:id="@+id/login_facebook_button" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="15dp" android:paddingBottom="15dp" android:layout_marginRight="30dp" android:layout_marginLeft="30dp"/> For Facebook SDK v4.x ( or rather than using separate xml style or programmatically ) The

android expandablelistview how to set space between groups items

半世苍凉 提交于 2019-11-30 07:24:06
I have expandablelistview and I want to add padding (or margin) between the groups items, I used margin-botton on the group items, it works but now it is also applied to the group item and its childs, I want to keep a space between groups items, not between a group item and its child, i work like this: main xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="#FFFFFF"> <TextView android:layout_width="wrap

What's the difference between @android: and ?android: [duplicate]

血红的双手。 提交于 2019-11-30 07:01:17
问题 This question already has an answer here : What's the difference between “?android:” and “@android:” in an android layout xml file? (1 answer) Closed 6 years ago . What's the difference between android:color="@android:color/black" and style="?android:attr/borderlessButtonStyle" What's the difference between the @ and ? ? This is one of those questions which is ungoogleable, or ogooglebar. 回答1: (from this answer and its comments) Prefixing the ID with a question mark indicates that you want to

Android - ImageView overlay another ImageView

删除回忆录丶 提交于 2019-11-30 06:55:48
I would like to make an ImageView overlay another ImageView like this; only half of the circle green is overlaying the image: I have tried using RelativeLayout and put both ImageView inside. Then I overlay the circle over the image by using android:layout_alignBottom . It did overlay the but I have no idea how to set the offset so that only half of the circle is overlaying the base image. EDIT: Sorry, here is my layout xml code <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginBottom="32sp" > <ImageView

Android org.xmlpull.v1.XmlPullParserException while parsing XML

ⅰ亾dé卋堺 提交于 2019-11-30 04:44:10
问题 I have a situation where i call a web service and it returns me some HTML in an XML envelop. like: <xml version="1.0" cache="false"> <head/> <body> <table> <tr> <td> <a href="link-to-prev-post"> <text color="red"><< Prev</text> </a> </td> <td> <a href="link-to-next-post"> <text color="red">| Next >></text> </a> </td> </tr> </table> </body> </xml> I have to retrieve the link-to-prev-post & link-to-next-post links.. so i can get more data through these links. I am using XmlPullParser to parse

Custom Dialog size to match Theme.Holo.Light.Dialog

馋奶兔 提交于 2019-11-30 04:09:53
If I have an Activity that has it's theme set to Theme.Holo.Light.Dialog , it will scale great. It will fill the screen on phones in portrait mode almost entirely but in landscape mode it won't stretch unreasonably long. For example, in this picture from Google, you can see the dialog not filling the whole screen. It won't either collapse to match the width of the title like what will happen if you have your own Dialog build by having a class that extends the Dialog class. This is what will happen with my layout. What properties do I need to apply to the LinearLayout to make it scale pretty?