The following is the code of main.xml, which i have used to create a row adapter for JSON
<?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:padding="4dp"
android:orientation="vertical"
android:weightSum="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_weight="0.88"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="pumpName"
android:id="#+id/tvPump" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Time"
android:id="#+id/tvTime"
android:gravity="center_vertical" />
</LinearLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/ivIcon"
android:src="#drawable/yes" />
</FrameLayout>
</LinearLayout>
</LinearLayout>
The above code produces no error but the Time TextView does not come at the center.
I have tried android:gravity="center" but it did not work.
This is the image of my android studio
Relative Layout could come in handy here like so:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="4dp">
<TextView
android:id="#+id/tvPump"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:text="pumpName"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/tvTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="Time"
android:textAppearance="?android:attr/textAppearanceLarge" />
<ImageView
android:layout_width="wrap_content"
android:id="#+id/ivIcon"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_height="wrap_content"
android:src="#drawable/yes" />
</RelativeLayout>
Related
I am looking to build a layout as above using linear/relative layouts with textbox.
Any help is appreciated.
Add background style to root layout for rounded corner and done
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#999999"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="#FFFFFF"
android:text="25"
android:padding="5dp"
android:textColor="#000000"
android:textSize="60sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="Sept \n2016"
android:padding="5dp"
android:textSize="25sp" />
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#999999"
android:layout_margin="20dp"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<View
android:layout_width="5dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#999999"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="#FFFFFF"
android:padding="10dp"
android:text="25"
android:textColor="#000000"
android:textSize="60sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="Sept \n2016"
android:textColor="#android:color/white"
android:padding="10dp"
android:textStyle="bold"
android:textSize="35sp" />
</LinearLayout>
</LinearLayout>
I'm trying to make a listView with progress bar exactly like the image below
I'm use android:layout_toRightOf to display the progressBar beside the Pro-XXX-XXX, but it display below the text .
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:id="#+id/ListProject"
android:textStyle="bold"
android:textColor="#color/black"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ProgressBar
android:id="#+id/downloadProgressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/ListProject" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/blue"
android:id="#+id/ListTimeIn"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/blue"
android:layout_toLeftOf="#+id/ListTimeIn"
android:id="#+id/ListTimeOut"/>
<TextView android:id="#+id/ListDescription"
android:layout_width="wrap_content"
android:textColor="#color/blue"
android:layout_height="wrap_content"/>
</LinearLayout>
Change to RelativeLayout
#Chintan answer
You need to use the tools provided with the Relative Layout.
Your ProgressBar needs to be "toRightOf" as well as "toEndOf" the TextView:
<?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">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp">
<TextView
android:id="#+id/ListProject"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingEnd="20dp"
android:paddingRight="20dp"
android:text="Test"
android:textColor="#color/black"
android:textStyle="bold"/>
<ProgressBar
android:id="#+id/downloadProgressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="#id/ListProject"
android:layout_toRightOf="#+id/ListProject"/>
</RelativeLayout>
<TextView
android:id="#+id/ListTimeIn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Test"/>
<TextView
android:id="#+id/ListTimeOut"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="test"/>
<TextView
android:id="#+id/ListDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="test"/>
</LinearLayout>
I have just tested this xml, and it works perfectly well.
put following code
<?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">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/ListProject"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="HProxx -cxcscdc"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="#+id/downloadProgressBar"
android:textColor="#color/black"
android:textStyle="bold" />
<ProgressBar
android:id="#+id/downloadProgressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
<TextView
android:id="#+id/ListTimeIn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="HProxx -cxcscdc"
android:textColor="#CADFFF" />
<TextView
android:id="#+id/ListTimeOut"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="#+id/ListTimeIn"
android:text="HProxx -cxcscdc"
android:textColor="#CADFFF" />
<TextView
android:id="#+id/ListDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="HProxx -cxcscdc"
android:textColor="#CADFFF" />
</LinearLayout>
Replace your xml with xml below.
<?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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/ListProject"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:lines="2"
android:textColor="#color/black"
android:textStyle="bold" />
<ProgressBar
android:id="#+id/downloadProgressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<TextView
android:id="#+id/ListTimeIn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/blue" />
<TextView
android:id="#+id/ListTimeOut"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="#+id/ListTimeIn"
android:textColor="#color/blue" />
<TextView
android:id="#+id/ListDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/blue" />
</LinearLayout>
Let me know if this works for you.
I'm beginner in android,and want to write xml file show two button center of screen horizontally,write this code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_centerHorizontal="true">
<TextView android:text="#+id/TextView01" android:id="#+id/TextView01"
android:layout_width="wrap_content" android:layout_height="wrap_content"/>
<Button
android:id="#+id/allow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/TextView01"
android:text="Allow"/>
<Button
android:id="#+id/deny"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/allow"
android:layout_alignTop="#id/allow"
android:text="Deny"/>
</RelativeLayout>
that show me this:
but i want this:
Try this code. It will give desired layout
<?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">
<TextView
android:id="#+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#+id/TextView01" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<Button
android:id="#+id/allow"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Allow" />
<Button
android:id="#+id/deny"
android:layout_width="wrap_content"
android:gravity="center"
android:layout_height="wrap_content"
android:text="Deny" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
Try this:
<Button
android:id="#+id/allow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:text="Allow"/>
<Button
android:id="#+id/deny"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/allow"
android:layout_alignTop="#id/allow"
android:text="Deny"/>
First try changing your RelativeLayout height to android:layout_height="match_parent".
After that you could put both buttons in a LinearLayout like this:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_centerInParent="true">
<Button
android:id="#+id/allow"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Allow" />
<Button
android:id="#+id/deny"
android:layout_width="wrap_content"
android:gravity="center"
android:layout_height="wrap_content"
android:text="Deny" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="#+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="some text or #string reference from strings.xml" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" >
<Button
android:id="#+id/allow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Allow" />
<Button
android:id="#+id/deny"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Deny" />
</LinearLayout>
</RelativeLayout>
I am trying to create an layout as shown in the figure.
In that image shipped to is attached to the border of the layout. how to overlap like that.
Here is the XML I am using to create that
<RelativeLayout
android:id="#+id/shipped_to_header"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="#drawable/address_blue_border" >
<TextView
android:id="#+id/tv_shipped_to"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/homebackground"
android:text="Shipped To"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/tv_door_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/tv_shipped_to"
android:text="22"
android:textColor="#android:color/black" />
<TextView
android:id="#+id/tv_address_line1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/tv_door_no"
android:text="Delhi, India"
android:textColor="#android:color/black" />
<TextView
android:id="#+id/tv_address_line2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/tv_address_line1"
android:text="Swindon Senegal BS32 8FE"
android:textColor="#android:color/black" />
</RelativeLayout>
Try this
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="8dp"
android:background="#android:color/holo_blue_bright"
android:orientation="vertical"
android:padding="10dp" >
<TextView
android:id="#+id/tv_door_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="22" />
<TextView
android:id="#+id/tv_address_line1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Delhi" />
<TextView
android:id="#+id/tv_address_line2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Some more dara" />
</LinearLayout>
<TextView
android:id="#+id/tv_shipped_to"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="Ship To"
android:background="#android:color/holo_blue_dark"
android:layout_marginLeft="15dp"
/>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:background="#android:color/white">
<!-- This is the main content -->
<RelativeLayout
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_margin="15dp" android:background="#drawable/frame"
android:orientation="vertical" android:padding="20dp">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="Main Content" android:layout_centerInParent="true" />
</RelativeLayout>
<!-- This is the title label -->
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
android:background="#android:color/white" android:padding="5dp"
android:text="Testing"
android:layout_marginLeft="30dp" android:textColor="#android:color/black" />
</RelativeLayout>
You can have your answer at here and here
To obtain a layout similar to the one it's in the image you have to use command android:layout_margin with negative values.
Here is an example:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="70dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="TextView" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:text="TextView" />
</RelativeLayout>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/relativeLayout1"
android:layout_alignParentLeft="true"
android:layout_marginBottom="-10dp"
android:text="TextView" />
</RelativeLayout>
Your image is a bit toooo small. Anyway, for that, use RelativeLayout.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="0dp" >
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_margin="20dp"
android:background="#ccff00"
android:orientation="vertical" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<!-- Your other TextViews -->
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/linearLayout1"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:background="#ccffff"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
I am trying to create very simple widget design. For the past two days I am still not able to complete it and I would appreciate your help.
What I am trying to do is something looks like this design:
Please note the size of the image buttons is 16pd for both height and width.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="center"
android:layout_margin="4dp"
android:background="#drawable/background" >
<TextView
android:id="#+id/tvDisplayer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="HDisplaer"
android:textSize="25px"
android:gravity="center"/>
<TextView
android:id="#+id/tvsmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:textSize="7px"
android:gravity="center"/>
<ImageButton
android:id="#+id/imRefresh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/refresh"
android:layout_gravity="left" />
<ImageButton
android:id="#+id/imOpen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/aboutus"
android:layout_gravity="right" />
</LinearLayout>
Wrap the ImageButtons with a RelativeLayout! Otherwise the code seems to be ok.
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageButton
android:id="#+id/imRefresh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/refresh"
android:layout_alignParentLeft="true" />
<ImageButton
android:id="#+id/imOpen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/aboutus"
android:layout_alignParentRight="true" />
</RelativeLayout>
If the TextViews are not centered, then wrap them with another RelativeLayout, and add to each TextView this line: android:layout_centerHorizontal="true"
Try this
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="50dp" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:text="TextView" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_below="#+id/textView1"
android:layout_centerInParent="true"
android:text="TextView" />
</RelativeLayout>
<ImageButton
android:id="#+id/imageButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/relativeLayout1"
android:src="#drawable/black" />
<ImageButton
android:id="#+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignTop="#+id/imageButton2"
android:src="#drawable/black" />
Just increase the height of the 2nd relative layout to bring it down.
Try this:
Just use two LinearLayout one for horizontal and other for vertical.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="center"
android:layout_margin="4dp"
android:background="#drawable/background" >
<TextView
android:id="#+id/tvDisplayer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="HDisplaer"
android:textSize="25px"
android:gravity="center"/>
<TextView
android:id="#+id/tvsmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:textSize="7px"
android:gravity="center"/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:gravity="center"
android:layout_margin="4dp"
>
<ImageButton
android:id="#+id/imRefresh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left" />
<ImageButton
android:id="#+id/imOpen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right" />
</LinearLayout>
</LinearLayout>