android-xml

Android Soft keyboard float only specific layout

夙愿已清 提交于 2019-12-01 02:16:47
问题 I have a layout, code below <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto"> <!--some stuff here--> <LinearLayout android:id="@+id/layout1" android:layout_alignParentBottom="true" android:layout_above="@+id/layout2" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <EditText android

Android org.xmlpull.v1.XmlPullParserException while parsing XML

拥有回忆 提交于 2019-11-30 20:16:01
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 the above provided XML/HTML. To get the links for next/prev items, i am doing as follows: if

(can't find id reference) No resource matches the given name at

拥有回忆 提交于 2019-11-30 18:27:37
I have the following inside a relative layout. <TextEdit android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@id/buttonA" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_toLeftOf="@id/buttonA" /> <Button android:id="@+id/buttonA" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:text="@string/message" > </Button> Eclipse gives me these errors at lines android:layout_alignBottom="@id/buttonA" and android:layout_toLeftOf="@id/buttonA"

What is android:includeFontPadding for?

∥☆過路亽.° 提交于 2019-11-30 17:54:22
You can use android:includeFontPadding="false" to get rid of the default padding in a TextView . Android docs say this about the attribute: Leave enough room for ascenders and descenders instead of using the font ascent and descent strictly. Questions: What does the above mean? What is this padding used for? Is it bad to turn it off and why? This is need for text size measure in height. If you turn it off, text will be forced to be some height, otherwise it will calculate height of each line with ascenders and descenders. 来源: https://stackoverflow.com/questions/35680999/what-is

how to make a relative layout scrollable when it has many children views?

谁都会走 提交于 2019-11-30 17:41:20
my xml goes as shown below <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/form_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/black" android:orientation="vertical" android:overScrollMode="ifContentScrolls" android:scrollbarStyle="insideOverlay" android:scrollbars="vertical" > <Spinner android:id="@+id/formulae" android:layout_width="200dp" android:layout_height="60dp" android:layout_marginLeft="50dp" android:layout_marginRight="50dp" android

How can I align an element to the right in the FrameLayout?

[亡魂溺海] 提交于 2019-11-30 17:12:41
I have a FrameLayout which contains 2 views , the second is something like a Close Button (X) and i want to position it on the right. I've tried layout_gravity = " right ", but that didn't work. This is my layout xml : <FrameLayout android:layout_width="320dp" android:layout_height="wrap_content" android:id="@+id/layoutSmallImg"> <ImageView android:id="@+id/bigImage" android:layout_width="320dp" android:layout_height="wrap_content"/> <ImageView android:id="@+id/bigImage" android:layout_width="320dp" android:layout_height="wrap_content"/> <ImageButton android:id="@+id/closebutton" android

how to make a relative layout scrollable when it has many children views?

别来无恙 提交于 2019-11-30 16:38:52
问题 my xml goes as shown below <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/form_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/black" android:orientation="vertical" android:overScrollMode="ifContentScrolls" android:scrollbarStyle="insideOverlay" android:scrollbars="vertical" > <Spinner android:id="@+id/formulae" android:layout_width="200dp" android

How to change `solid color` from the code?

我们两清 提交于 2019-11-30 16:32:12
I have a Shape defined in xml . Now I need to change a solid color from the code, could you please advice how? <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:padding="10dp"> <solid android:color="#000000"/> <corners android:bottomRightRadius="8dp" android:bottomLeftRadius="8dp" android:topLeftRadius="0dp" android:topRightRadius="0dp"/> </shape> I use this in my code GradientDrawable myGrad = (GradientDrawable)rectangle.getBackground(); myGrad.setColor(Color.BLACK); Hope this helps :) EDIT: for

How can I align an element to the right in the FrameLayout?

匆匆过客 提交于 2019-11-30 16:29:18
问题 I have a FrameLayout which contains 2 views , the second is something like a Close Button (X) and i want to position it on the right. I've tried layout_gravity = " right ", but that didn't work. This is my layout xml : <FrameLayout android:layout_width="320dp" android:layout_height="wrap_content" android:id="@+id/layoutSmallImg"> <ImageView android:id="@+id/bigImage" android:layout_width="320dp" android:layout_height="wrap_content"/> <ImageView android:id="@+id/bigImage" android:layout_width=

Android shape with gradient border and shadow

泪湿孤枕 提交于 2019-11-30 15:34:48
I have a png drawable for the buttons. But it image drawable has gradient and it looks bad when applying 9patch (gradient & 9patch non compatible). I want to do this with a shapes. But I can't drawing with android shapes because it's hard to me to understand it. Can you help me to draw this image with a shapes? It's contain a border gradient, orange rectangle inside with a rounded corners and shadow 120° Here you go Create your layout <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android