how to align controls left, right and center in relative layout in android -


i have 3 controls want 1 aligned left, other centered, , last way right in relative layout.

i have tried following:

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical"     android:layout_width="fill_parent"     android:layout_height="match_parent">      <relativelayout android:id="@+id/relativelayout01"         android:layout_width="fill_parent"         android:layout_height="wrap_content"         xmlns:android="http://schemas.android.com/apk/res/android">           <imageview             android:id="@+id/backimg"             android:layout_width="fill_parent"             android:layout_height="wrap_content"             android:src="@drawable/back"             android:background="@null"             android:layout_alignparentleft="true"              />          <imageview             android:id="@+id/logoimg"             android:layout_width="fill_parent"             android:layout_height="wrap_content"             android:src="@drawable/logo"             android:background="@null"             android:layout_centerhorizontal="true"             />          <imagebutton             android:id="@+id/closebtn"             android:layout_width="fill_parent"             android:layout_height="wrap_content"             android:src="@drawable/close"             android:background="@null"             android:layout_alignparentright="true"             />      </relativelayout>        <webview  xmlns:android="http://schemas.android.com/apk/res/android"         android:id="@+id/webview"         android:layout_width="fill_parent"         android:layout_height="fill_parent"         />  </linearlayout> 

this stacks of controls on top of each other.

how can this:

enter image description here

change imageviews width wrap_content , want here new code

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="match_parent">  <relativelayout android:id="@+id/relativelayout01"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     xmlns:android="http://schemas.android.com/apk/res/android">       <imageview         android:id="@+id/backimg"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@drawable/back"         android:background="@null"         android:layout_alignparentleft="true"          />      <imageview         android:id="@+id/logoimg"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@drawable/logo"         android:background="@null"         android:layout_centerhorizontal="true"         />      <imagebutton         android:id="@+id/closebtn"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@drawable/close"         android:background="@null"         android:layout_alignparentright="true"         />  </relativelayout>    <webview  xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/webview"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     /> 


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -