Android XML alignment issue with Linear and RelativeLayouts. -


i want design layout in android xml

enter image description here

i wrote xml , works fine without putting "text view 2" code.

this xml file without putting text view 2 :-

<?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="@drawable/txtbackground"      >  <relativelayout      android:layout_height="wrap_content"     android:layout_width="wrap_content"     android:id="@+id/header"     >      <!-- textview 1 -->     <textview      android:id="@+id/textview1"         android:text="item"         android:layout_alignparentright="true"         android:background="@drawable/txtbackground"         android:layout_aligntop="@+id/list_image"         android:layout_torightof="@+id/list_image"         android:layout_width="wrap_content"         android:textsize="18dip"         android:layout_height="100dip"         android:textcolor="#000000"         android:textstyle="bold"      />      <imageview          android:id="@+id/list_image"        android:layout_alignparentleft="true"         android:layout_width="100dip"         android:layout_height="100dip"         android:src="@drawable/image"     />  </relativelayout>      <!-- webview  -->     <linearlayout android:id="@+id/thumbnail"         android:layout_width="fill_parent"         android:layout_height="fill_parent"         android:padding="0dip"         android:layout_below="@+id/header"         android:layout_margintop="5dip"         >           <webview         xmlns:android="http://schemas.android.com/apk/res/android"         android:id="@+id/webkit"         android:layout_width="fill_parent"         android:layout_height="fill_parent"         android:layout_alignparentleft="true"      />      </linearlayout>      </relativelayout> 

can plz suggest me should put textview2 code works given graphical layout image.

code textview 2 same textview 1:-

<!-- textview 2 -->         <textview          android:id="@+id/textview2"             android:text="item"             android:layout_alignparentright="true"             android:background="@drawable/txtbackground"             android:layout_aligntop="@+id/list_image"             android:layout_torightof="@+id/list_image"             android:layout_width="wrap_content"             android:textsize="18dip"             android:layout_height="100dip"             android:textcolor="#000000"             android:textstyle="bold"          /> 

thanks in advance.

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical" android:layout_width="fill_parent"     android:layout_height="fill_parent">      <imageview         android:id="@+id/imageview1"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignparentleft="true"         android:layout_alignparenttop="true"         android:src="@drawable/icon" />      <textview         android:id="@+id/textview1"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignparenttop="true"         android:layout_marginleft="24dp"         android:layout_torightof="@+id/imageview1"         android:text="large text"         android:textappearance="?android:attr/textappearancelarge" />      <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:text="large text"         android:textappearance="?android:attr/textappearancelarge" />      <webview         android:id="@+id/webview1"         android:layout_width="match_parent"         android:layout_height="match_parent"         android:layout_alignparentleft="true"         android:layout_below="@+id/textview2" />  </relativelayout> 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -