I
istbanane
Neues Mitglied
- 0
Hi, ich möchte gern in die android entwicklung einsteigen. Das scheint nicht ganz so einfach zu sein.
Folgendes Problem:
Ich habe ein Fragment. In diesem Fragment habe ich eine ListView:
In bzw auf diese Listview soll folgendes Element (listitem.xml) eingebunden werden:
In meiner Javadatei binde ich das Layout so ein:
Das funktioniert soweit.
Nur wie kann ich das zweite Element (listitem) auf die ListView setzen?
Kann mir jemand weiterhelfen?
Gruß
HansPeter
Folgendes Problem:
Ich habe ein Fragment. In diesem Fragment habe ich eine ListView:
PHP:
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
In bzw auf diese Listview soll folgendes Element (listitem.xml) eingebunden werden:
PHP:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<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/ic_launcher" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="23dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="@+id/imageView1"
android:text="CodeLearn Chapter 1"
android:textSize="16sp" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/imageView1"
android:layout_alignLeft="@+id/textView1"
android:text="Description" />
</RelativeLayout>
In meiner Javadatei binde ich das Layout so ein:
PHP:
View rootView = inflater.inflate(R.layout.fragment_first_start, container, false);
return rootView
Das funktioniert soweit.
Nur wie kann ich das zweite Element (listitem) auf die ListView setzen?
Kann mir jemand weiterhelfen?
Gruß
HansPeter