- Forum posts: 4
Nov 9, 2015, 11:04:04 AM via Website
Nov 9, 2015 11:04:04 AM via Website
Guys
I have on this all weekend and its driving me crazy
I am designing a custom Listview the code of my view is as follows
<RelativeLayout xmlns:android="XXXXX"
xmlns:tools=XXXXXX"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".nestedLayoutActivity" >
<LinearLayout
android:id="@+id/ll1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:eek:rientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:eek:rientation="vertical" >
<TextView
android:id="@+id/Sr2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="Medium Text"
android:textColor="#000"
android:textSize="8dp" />
<TextView
android:id="@+id/Sr3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/Sr2"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/imageView1"
android:text="Medium Text"
android:textColor="#000"
android:textSize="8dp" />
<TextView
android:id="@+id/Sr4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/Sr3"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/imageView1"
android:text="Medium Text"
android:textColor="#000"
android:textSize="8dp" />
<TextView
android:id="@+id/Sr5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/Sr4"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/imageView1"
android:text="Medium Text"
android:textColor="#000"
android:textSize="8dp" />
<TextView
android:id="@+id/Sr6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/Sr5"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/imageView1"
android:text="Medium Text"
android:textColor="#000"
android:textSize="8dp" />
<TextView
android:id="@+id/Sr7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/Sr6"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/imageView1"
android:text="Medium Text"
android:textColor="#000"
android:textSize="8dp" />
<TextView
android:id="@+id/Sr8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/Sr7"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/imageView1"
android:text="Medium Text"
android:textColor="#000"
android:textSize="8dp" />
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/Sr2"
android:layout_alignTop="@+id/imageView1"
android:layout_marginLeft="10dp"
android:text="Medium Text"
android:textColor="#000"
android:textSize="8dp" />
</LinearLayout>
</RelativeLayout>
I am trying to get two linear layouts inside a relative layout to be side by side with layout on left taking 30% of width and layout on right taking 70%
The reason I need two layouts inside is that the layout on the left will contain an imageview which will grow bigger or smaller depending on device used while keeping proportion of 30% and the layout on right had 7 textviews each one under anther giving details.
The code above sort of does it but both views are on top of each other
Any idea where I am going wrong
Any help appreciated
Mark