Martin Bories
- Forum-Beiträge: 3
26.04.2012, 21:41:16 via Website
26.04.2012 21:41:16 via Website
Hey.
Bin dabei, eine ListView zu gestalten, und am verzweifeln, da nicht genügend Platz da ist und die Inhalte abgeschnitten werden ^ ^.
Folgender Aufbau:
Ich habe eine ListView, in der mehrere ListViews stehen. In jeder dieser unteren ListView stehen mehrere TextView.
Was ich erreichen möchte:
1. auch bei längerem Inhalt (mehrere Zeilen) soll der Text in jedem TextView vollständig angezeigt werden und nicht abgeschnitten werden. (Das dürfte mein größtes Problem schonmal lösen )
2. Die unteren ListViews sind natürlich alle unterschiedlich groß (unterschiedliche Textlängen usw). Diese sollen ebenfalls in der oberen ListView nicht abgeschnitten werden.
Grobe Skizzierung:
Mein XML-Code ist:
Zum füllen der oberen ListView:
Und für die untere ListView:
Ich hoffe sehr, dass mir jemand helfen kann..
Vielen Dank und viele Grüße,
Martin
Bin dabei, eine ListView zu gestalten, und am verzweifeln, da nicht genügend Platz da ist und die Inhalte abgeschnitten werden ^ ^.
Folgender Aufbau:
Ich habe eine ListView, in der mehrere ListViews stehen. In jeder dieser unteren ListView stehen mehrere TextView.
Was ich erreichen möchte:
1. auch bei längerem Inhalt (mehrere Zeilen) soll der Text in jedem TextView vollständig angezeigt werden und nicht abgeschnitten werden. (Das dürfte mein größtes Problem schonmal lösen )
2. Die unteren ListViews sind natürlich alle unterschiedlich groß (unterschiedliche Textlängen usw). Diese sollen ebenfalls in der oberen ListView nicht abgeschnitten werden.
Grobe Skizzierung:
Mein XML-Code ist:
Zum füllen der oberen ListView:
1<?xml version="1.0" encoding="utf-8"?>
2<RelativeLayout
3 xmlns:android="http://schemas.android.com/apk/res/android"
4 android:layout_width="match_parent"
5 android:layout_height="fill_parent"
6 android:orientation="vertical" >
7
8 <ImageView
9 android:id="@+id/contactPhoto"
10 android:layout_width="64dp"
11 android:layout_height="64dp"
12 android:layout_alignParentBottom="true"
13 android:layout_alignParentLeft="true"
14 android:layout_alignParentTop="true"
15 android:src="@drawable/ic_contact_picture" />
16
17 <ListView
18 android:id="@+id/messageList"
19 android:layout_width="match_parent"
20 android:layout_height="fill_parent"
21 android:layout_alignParentTop="true"
22 android:layout_toRightOf="@+id/contactPhoto">
23 </ListView>
24
25</RelativeLayout>
2<RelativeLayout
3 xmlns:android="http://schemas.android.com/apk/res/android"
4 android:layout_width="match_parent"
5 android:layout_height="fill_parent"
6 android:orientation="vertical" >
7
8 <ImageView
9 android:id="@+id/contactPhoto"
10 android:layout_width="64dp"
11 android:layout_height="64dp"
12 android:layout_alignParentBottom="true"
13 android:layout_alignParentLeft="true"
14 android:layout_alignParentTop="true"
15 android:src="@drawable/ic_contact_picture" />
16
17 <ListView
18 android:id="@+id/messageList"
19 android:layout_width="match_parent"
20 android:layout_height="fill_parent"
21 android:layout_alignParentTop="true"
22 android:layout_toRightOf="@+id/contactPhoto">
23 </ListView>
24
25</RelativeLayout>
Und für die untere ListView:
1<?xml version="1.0" encoding="utf-8"?>
2<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:layout_width="match_parent"
4 android:layout_height="fill_parent"
5 android:orientation="vertical">
6
7 <TextView
8 android:id="@+id/messageTime"
9 android:layout_width="wrap_content"
10 android:layout_height="fill_parent"
11 android:layout_alignParentRight="true"
12 android:text="12:47"
13 android:textAppearance="?android:attr/textAppearanceSmall" />
14
15 <TextView
16 android:id="@+id/messageText"
17 android:layout_width="wrap_content"
18 android:layout_height="fill_parent"
19 android:layout_alignBottom="@+id/messageTime"
20 android:layout_alignParentLeft="true"
21 android:layout_alignParentTop="true"
22 android:layout_toLeftOf="@+id/messageTime"
23 android:scrollHorizontally="false"
24 android:singleLine="false"
25 android:text="TextView" />
26
27</RelativeLayout>
2<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:layout_width="match_parent"
4 android:layout_height="fill_parent"
5 android:orientation="vertical">
6
7 <TextView
8 android:id="@+id/messageTime"
9 android:layout_width="wrap_content"
10 android:layout_height="fill_parent"
11 android:layout_alignParentRight="true"
12 android:text="12:47"
13 android:textAppearance="?android:attr/textAppearanceSmall" />
14
15 <TextView
16 android:id="@+id/messageText"
17 android:layout_width="wrap_content"
18 android:layout_height="fill_parent"
19 android:layout_alignBottom="@+id/messageTime"
20 android:layout_alignParentLeft="true"
21 android:layout_alignParentTop="true"
22 android:layout_toLeftOf="@+id/messageTime"
23 android:scrollHorizontally="false"
24 android:singleLine="false"
25 android:text="TextView" />
26
27</RelativeLayout>
Ich hoffe sehr, dass mir jemand helfen kann..
Vielen Dank und viele Grüße,
Martin