MeteHan
MeteHan

Reputation: 287

Xamarin Listview Multiple TextViews

I created a listview with an ImageView and a Textview. It works fine. The thing is I tried adding another TextView but it doesnt display like its supposed to. I did all the coding.

Something i noticed when i cut the last TextView i tried to add and then copy it to below other TextView, last TextView starts displaying. Its strange. Here is my Model Axml file

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="100dp"
android:layout_height="100dp">
<ImageView
    android:src="@drawable/czz"
    android:layout_width="55dp"
    android:layout_height="55dp"
    android:id="@+id/yemek_foto"
    android:layout_marginRight="0.0dp"
    android:padding="5dp" />

    <TextView
    android:layout_width="55dp"
    android:layout_height="55dp"
    android:id="@+id/text2"
    android:layout_marginRight="0.0dp"
    android:padding="5dp" >
    </TextView>

  <TextView
  android:text="Medium Text"
  android:textAppearance="?android:attr/textAppearanceMedium"
  android:layout_width="wrap_content"
  android:layout_height="45.0dp"
  android:padding="5dp"
  android:layout_marginLeft="5dp"
  android:id="@+id/text_ismi"
  android:layout_toRightOf="@+id/yemek_foto"
  android:layout_alignParentRight="true"
  android:textColor="#000" >
  </TextView>

 </LinearLayout>

Thanks in advance

Upvotes: 0

Views: 252

Answers (1)

abhishek
abhishek

Reputation: 26

{

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="100dp"
android:layout_height="wrap_content">
<ImageView
    android:src="@drawable/czz"
    android:layout_width="55dp"
    android:layout_height="55dp"
    android:id="@+id/yemek_foto"
    android:layout_marginRight="0.0dp"
    android:padding="5dp" />

    <TextView
    android:layout_width="55dp"
    android:layout_height="55dp"
    android:id="@+id/text2"
    android:layout_marginRight="0.0dp"
    android:padding="5dp" >
    </TextView>

  <TextView
  android:text="Medium Text"
  android:textAppearance="?android:attr/textAppearanceMedium"
  android:layout_width="wrap_content"
  android:layout_height="45.0dp"
  android:padding="5dp"
  android:layout_marginLeft="5dp"
  android:id="@+id/text_ismi"
  android:layout_toRightOf="@+id/yemek_foto"
  android:layout_alignParentRight="true"
  android:textColor="#000" >
  </TextView>

 </LinearLayout>

}

I think this would work.

Upvotes: 1

Related Questions