Stefan S.
- Forum-Beiträge: 3
06.03.2014, 18:40:05 via Website
06.03.2014 18:40:05 via Website
Hallo zusammen,
derzeit Programmiere ich an einer kleinen Android-App für eine Website. In dieser App lade ich die Profilbilder der einzelnen User herunter wenn ich aufs Profil zugreife, jedoch wird es unter unterschiedlichen Auflösungen anders dargestellt.
Hier so wie es aussehen sollte:
und hier wie es dann z.B. auf dem Nexus One (Emulator) aussieht:
Mein Layout hierfür ist wie folgt:
Danke schon einmal im Voraus,
Grüße Stefan
derzeit Programmiere ich an einer kleinen Android-App für eine Website. In dieser App lade ich die Profilbilder der einzelnen User herunter wenn ich aufs Profil zugreife, jedoch wird es unter unterschiedlichen Auflösungen anders dargestellt.
Hier so wie es aussehen sollte:
und hier wie es dann z.B. auf dem Nexus One (Emulator) aussieht:
Mein Layout hierfür ist wie folgt:
1<RelativeLayout
2 android:id="@+id/userContent"
3 android:layout_width="match_parent"
4 android:layout_height="wrap_content"
5 android:layout_marginTop="10dp"
6 android:background="@drawable/white_item_with_shadow"
7 android:paddingBottom="10dp" >
8
9 <ImageView
10 android:id="@+id/userImage"
11 android:layout_width="wrap_content"
12 android:layout_height="wrap_content"
13 android:layout_alignParentLeft="true"
14 android:layout_alignParentTop="true"
15 android:layout_marginTop="10dp"
16 android:contentDescription="@string/user_image"
17 android:maxHeight="100dp"
18 android:maxWidth="180dp"
19 android:minHeight="50dp"
20 android:minWidth="90dp"
21 android:scaleType="centerInside"
22 android:src="@drawable/user_image" />
23
24 <TextView
25 android:id="@+id/countryText"
26 android:layout_width="wrap_content"
27 android:layout_height="wrap_content"
28 android:layout_alignBottom="@+id/userImage"
29 android:layout_alignLeft="@+id/forumNameText"
30 android:ellipsize="end"
31 android:singleLine="true"
32 android:text="Country:" />
33
34 <TextView
35 android:id="@+id/forumNameText"
36 android:layout_width="wrap_content"
37 android:layout_height="wrap_content"
38 android:layout_above="@+id/countryText"
39 android:layout_centerHorizontal="true"
40 android:ellipsize="end"
41 android:singleLine="true"
42 android:text="Forumname: " />
43
44 <TextView
45 android:id="@+id/memberCountry"
46 android:layout_width="wrap_content"
47 android:layout_height="wrap_content"
48 android:layout_alignLeft="@+id/forumName"
49 android:layout_below="@+id/forumNameText"
50 android:ellipsize="end"
51 android:singleLine="true"
52 android:text="@string/placeholder" />
53
54 <TextView
55 android:id="@+id/forumName"
56 android:layout_width="wrap_content"
57 android:layout_height="wrap_content"
58 android:layout_alignBaseline="@+id/forumNameText"
59 android:layout_alignBottom="@+id/forumNameText"
60 android:layout_toRightOf="@+id/forumNameText"
61 android:ellipsize="end"
62 android:singleLine="true"
63 android:text="@string/placeholder" />
64 </RelativeLayout>
2 android:id="@+id/userContent"
3 android:layout_width="match_parent"
4 android:layout_height="wrap_content"
5 android:layout_marginTop="10dp"
6 android:background="@drawable/white_item_with_shadow"
7 android:paddingBottom="10dp" >
8
9 <ImageView
10 android:id="@+id/userImage"
11 android:layout_width="wrap_content"
12 android:layout_height="wrap_content"
13 android:layout_alignParentLeft="true"
14 android:layout_alignParentTop="true"
15 android:layout_marginTop="10dp"
16 android:contentDescription="@string/user_image"
17 android:maxHeight="100dp"
18 android:maxWidth="180dp"
19 android:minHeight="50dp"
20 android:minWidth="90dp"
21 android:scaleType="centerInside"
22 android:src="@drawable/user_image" />
23
24 <TextView
25 android:id="@+id/countryText"
26 android:layout_width="wrap_content"
27 android:layout_height="wrap_content"
28 android:layout_alignBottom="@+id/userImage"
29 android:layout_alignLeft="@+id/forumNameText"
30 android:ellipsize="end"
31 android:singleLine="true"
32 android:text="Country:" />
33
34 <TextView
35 android:id="@+id/forumNameText"
36 android:layout_width="wrap_content"
37 android:layout_height="wrap_content"
38 android:layout_above="@+id/countryText"
39 android:layout_centerHorizontal="true"
40 android:ellipsize="end"
41 android:singleLine="true"
42 android:text="Forumname: " />
43
44 <TextView
45 android:id="@+id/memberCountry"
46 android:layout_width="wrap_content"
47 android:layout_height="wrap_content"
48 android:layout_alignLeft="@+id/forumName"
49 android:layout_below="@+id/forumNameText"
50 android:ellipsize="end"
51 android:singleLine="true"
52 android:text="@string/placeholder" />
53
54 <TextView
55 android:id="@+id/forumName"
56 android:layout_width="wrap_content"
57 android:layout_height="wrap_content"
58 android:layout_alignBaseline="@+id/forumNameText"
59 android:layout_alignBottom="@+id/forumNameText"
60 android:layout_toRightOf="@+id/forumNameText"
61 android:ellipsize="end"
62 android:singleLine="true"
63 android:text="@string/placeholder" />
64 </RelativeLayout>
Danke schon einmal im Voraus,
Grüße Stefan
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.