Bonjour,
Comme vous pouvez le voir dans le code ci dessous mon ImageView a une taille fixe. J'aimerais maintenant que l'ImageView prenne 30% du LinearLayout.
Comment faire ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:background="@drawable/bloc_article" android:paddingRight="5dp" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <ImageView android:id="@+id/item_miniature" android:layout_width="120dp" android:layout_height="75dp" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingLeft="5dp" android:orientation="vertical"> <TextView android:id="@+id/titre" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="end" android:textColor="#0b3178" android:textSize="14sp" /> <TextView android:id="@+id/date" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#303030" android:textStyle="italic" android:textSize="12sp" /> <TextView android:id="@+id/extrait" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#000000" android:singleLine="false" android:ellipsize="end" android:lineSpacingExtra="4sp" android:maxLines="2" android:textSize="12sp" /> </LinearLayout> </LinearLayout> </LinearLayout>
Partager