mybecks
- Forum-Beiträge: 27
28.09.2010, 16:48:40 via Website
28.09.2010 16:48:40 via Website
Hallo zusammen,
habe eine Anwendung erstellt, welche mir gewisse Infos zu Termine und/oder Personen ausgibt. Nun kann es natürlich vorkommen, dass der Platz auf dem Bildschirm nicht ausreicht. Dann werden ja die Elemente ins Nirvana geschoben.
Nun tritt dieser Fall ein, deshalb hab ich mich für eine ScrollView als Layout entscheiden. Nun wird aber die ListView ganz klein Angezeigt, sprich 1,5 Zeilen sind sichtbar, den Rest müsste man scrollen. Somit passen alle Elemente auf das Layout!
Aber ich möchte, dass egal wie groß die ListView ist, sie komplett angezeigt wird und dann die ScrollView einspringt um den Rest der Elemente (hier der Button) angezeigt wird.
Hier mein Layout (das ganze befindet sich innerhalb eines TabHos, der die Tabs "Bottom" anzeigt):
Viele Grüße,
mybecks
habe eine Anwendung erstellt, welche mir gewisse Infos zu Termine und/oder Personen ausgibt. Nun kann es natürlich vorkommen, dass der Platz auf dem Bildschirm nicht ausreicht. Dann werden ja die Elemente ins Nirvana geschoben.
Nun tritt dieser Fall ein, deshalb hab ich mich für eine ScrollView als Layout entscheiden. Nun wird aber die ListView ganz klein Angezeigt, sprich 1,5 Zeilen sind sichtbar, den Rest müsste man scrollen. Somit passen alle Elemente auf das Layout!
Aber ich möchte, dass egal wie groß die ListView ist, sie komplett angezeigt wird und dann die ScrollView einspringt um den Rest der Elemente (hier der Button) angezeigt wird.
Hier mein Layout (das ganze befindet sich innerhalb eines TabHos, der die Tabs "Bottom" anzeigt):
1<FrameLayout android:id="@android:id/tabcontent"
2 android:layout_width="fill_parent"
3 android:layout_height="fill_parent"
4 android:paddingBottom="65dp">
5<!--Start Details-->
6
7 <ScrollView
8 android:id="@+id/ll_details"
9 android:layout_width="fill_parent"
10 android:layout_height="fill_parent">
11 <LinearLayout
12 android:layout_width="fill_parent"
13 android:layout_height="wrap_content"
14 android:padding="10dp"
15 android:orientation="vertical">
16 <TextView
17 android:layout_width="fill_parent"
18 android:layout_height="wrap_content"
19 android:text="@string/appointment_details"
20 android:textStyle="bold"
21 android:textColor="@color/grey"
22 android:layout_marginTop="5dp"/>
23
24 <LinearLayout
25 android:id="@+id/ll_appointment_details"
26 android:layout_width="fill_parent"
27 android:layout_height="wrap_content"
28 android:orientation="horizontal"
29 android:layout_marginTop="5dp"
30 android:background="@layout/my_border">
31
32 <TextView
33 android:layout_width="50dp"
34 android:layout_height="wrap_content"
35 android:text="@string/appointment_details_keyword"
36 android:textSize="10sp" />
37 <TextView
38 android:id="@+id/appointment_details_keyword"
39 android:layout_width="wrap_content"
40 android:layout_height="wrap_content"
41 android:textStyle="bold" />
42 </LinearLayout>
43
44 <TextView
45 android:layout_width="fill_parent"
46 android:layout_height="wrap_content"
47 android:text="@string/appointment_details_timestamp"
48 android:textStyle="bold"
49 android:textColor="@color/grey"
50 android:layout_marginTop="15dp"/>
51
52 <LinearLayout
53 android:layout_width="fill_parent"
54 android:layout_height="wrap_content"
55 android:orientation="vertical"
56 android:background="@layout/my_border"
57 android:layout_marginTop="5dp">
58
59 <LinearLayout
60 android:id="@+id/ll_appointment_details_start"
61 android:layout_width="fill_parent"
62 android:layout_height="wrap_content"
63 android:orientation="horizontal">
64 <TextView
65 android:layout_width="50dp"
66 android:layout_height="wrap_content"
67 android:text="@string/appointment_details_start"
68 android:textSize="10sp" />
69 <TextView
70 android:id="@+id/appointment_details_start"
71 android:layout_width="wrap_content"
72 android:layout_height="wrap_content"
73 android:textStyle="bold" />
74 </LinearLayout>
75
76 <LinearLayout
77 android:id="@+id/ll_appointment_details_end"
78 android:layout_width="fill_parent"
79 android:layout_height="wrap_content"
80 android:orientation="horizontal">
81 <TextView
82 android:layout_width="50dp"
83 android:layout_height="wrap_content"
84 android:text="@string/appointment_details_end"
85 android:textSize="10sp" />
86 <TextView
87 android:id="@+id/appointment_details_end"
88 android:layout_width="wrap_content"
89 android:layout_height="wrap_content"
90 android:textStyle="bold" />
91 </LinearLayout>
92 </LinearLayout>
93
94 <TextView
95 android:layout_width="fill_parent"
96 android:layout_height="wrap_content"
97 android:text="@string/appointment_details_participants"
98 android:textStyle="bold"
99 android:layout_marginTop="15dp"
100 android:textColor="@color/grey" />
101
102 <ListView
103 android:id="@+id/participants"
104 android:layout_width="fill_parent"
105 android:layout_height="fill_parent"
106 android:layout_marginTop="5dp"
107 android:background="@layout/my_border" />
108
109 <Button
110 android:id="@+id/appointment_dossier"
111 android:layout_width="fill_parent"
112 android:layout_height="wrap_content"
113 android:text="@string/appointment_details_dossier"
114 android:layout_marginTop="15dp" />
115 </LinearLayout>
116 </ScrollView>
117<!--End Details-->
2 android:layout_width="fill_parent"
3 android:layout_height="fill_parent"
4 android:paddingBottom="65dp">
5<!--Start Details-->
6
7 <ScrollView
8 android:id="@+id/ll_details"
9 android:layout_width="fill_parent"
10 android:layout_height="fill_parent">
11 <LinearLayout
12 android:layout_width="fill_parent"
13 android:layout_height="wrap_content"
14 android:padding="10dp"
15 android:orientation="vertical">
16 <TextView
17 android:layout_width="fill_parent"
18 android:layout_height="wrap_content"
19 android:text="@string/appointment_details"
20 android:textStyle="bold"
21 android:textColor="@color/grey"
22 android:layout_marginTop="5dp"/>
23
24 <LinearLayout
25 android:id="@+id/ll_appointment_details"
26 android:layout_width="fill_parent"
27 android:layout_height="wrap_content"
28 android:orientation="horizontal"
29 android:layout_marginTop="5dp"
30 android:background="@layout/my_border">
31
32 <TextView
33 android:layout_width="50dp"
34 android:layout_height="wrap_content"
35 android:text="@string/appointment_details_keyword"
36 android:textSize="10sp" />
37 <TextView
38 android:id="@+id/appointment_details_keyword"
39 android:layout_width="wrap_content"
40 android:layout_height="wrap_content"
41 android:textStyle="bold" />
42 </LinearLayout>
43
44 <TextView
45 android:layout_width="fill_parent"
46 android:layout_height="wrap_content"
47 android:text="@string/appointment_details_timestamp"
48 android:textStyle="bold"
49 android:textColor="@color/grey"
50 android:layout_marginTop="15dp"/>
51
52 <LinearLayout
53 android:layout_width="fill_parent"
54 android:layout_height="wrap_content"
55 android:orientation="vertical"
56 android:background="@layout/my_border"
57 android:layout_marginTop="5dp">
58
59 <LinearLayout
60 android:id="@+id/ll_appointment_details_start"
61 android:layout_width="fill_parent"
62 android:layout_height="wrap_content"
63 android:orientation="horizontal">
64 <TextView
65 android:layout_width="50dp"
66 android:layout_height="wrap_content"
67 android:text="@string/appointment_details_start"
68 android:textSize="10sp" />
69 <TextView
70 android:id="@+id/appointment_details_start"
71 android:layout_width="wrap_content"
72 android:layout_height="wrap_content"
73 android:textStyle="bold" />
74 </LinearLayout>
75
76 <LinearLayout
77 android:id="@+id/ll_appointment_details_end"
78 android:layout_width="fill_parent"
79 android:layout_height="wrap_content"
80 android:orientation="horizontal">
81 <TextView
82 android:layout_width="50dp"
83 android:layout_height="wrap_content"
84 android:text="@string/appointment_details_end"
85 android:textSize="10sp" />
86 <TextView
87 android:id="@+id/appointment_details_end"
88 android:layout_width="wrap_content"
89 android:layout_height="wrap_content"
90 android:textStyle="bold" />
91 </LinearLayout>
92 </LinearLayout>
93
94 <TextView
95 android:layout_width="fill_parent"
96 android:layout_height="wrap_content"
97 android:text="@string/appointment_details_participants"
98 android:textStyle="bold"
99 android:layout_marginTop="15dp"
100 android:textColor="@color/grey" />
101
102 <ListView
103 android:id="@+id/participants"
104 android:layout_width="fill_parent"
105 android:layout_height="fill_parent"
106 android:layout_marginTop="5dp"
107 android:background="@layout/my_border" />
108
109 <Button
110 android:id="@+id/appointment_dossier"
111 android:layout_width="fill_parent"
112 android:layout_height="wrap_content"
113 android:text="@string/appointment_details_dossier"
114 android:layout_marginTop="15dp" />
115 </LinearLayout>
116 </ScrollView>
117<!--End Details-->
Viele Grüße,
mybecks
Empfohlener redaktioneller Inhalt
Mit Deiner Zustimmung wird hier ein externer Inhalt geladen.
Mit Klick auf den oben stehenden Button erklärst Du Dich damit einverstanden, dass Dir externe Inhalte angezeigt werden dürfen. Dabei können personenbezogene Daten an Drittanbieter übermittelt werden. Mehr Infos dazu findest Du in unserer Datenschutzerklärung.