1 pièce(s) jointe(s)
dimensions sur les boutons
Bonjour à tous, j'ai depuis qq jours un problème de mesures sur mes boutons. Si j'augmente le textSize du bouton la largeur du bouton augmente aussi ( l'espace entre le bord du bouton et le texte du bouton reste toujours fixe) et je ne peut pas contrôler le "weight".
C'est un relative layout avec trois fois deux boutons l'un à coté de l'autre.
Je vous met le xml et un capture d'écran en piece jointe.
Code:
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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
| <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/linearLayout3"
android:layout_alignParentLeft="true"
android:background="@drawable/fondp"
android:orientation="vertical" >
</LinearLayout>
<TextView
android:id="@+id/textView2"
style="@style/MyCustomTheme"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_gravity="top|center"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:fontFamily="sans"
android:text="@string/lajares"
android:textColor="@color/textcollaj"
android:textSize="50sp"
android:textStyle="bold"
android:typeface="monospace" />
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="45dp"
android:background="#999"
android:orientation="horizontal"
android:paddingBottom="2dp"
android:paddingTop="2dp" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#2F4F4F"
android:paddingRight="2dp"
android:text="@string/testClick"
android:textSize="19sp" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_weight="1"
android:background="#2F4F4F"
android:paddingLeft="2dp"
android:text="@string/text2"
android:textSize="19sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/linearLayout1"
android:layout_alignParentLeft="true"
android:layout_marginBottom="45dp"
android:background="#999"
android:orientation="horizontal"
android:paddingBottom="2dp" >
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="4dp"
android:layout_weight="1"
android:background="#2F4F4F"
android:paddingRight="2dp"
android:text="@string/text3"
android:textSize="19sp" />
<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#2F4F4F"
android:text="@string/text4"
android:textSize="19sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#999"
android:orientation="horizontal"
android:paddingTop="2dp" >
<Button
android:id="@+id/button5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#2F4F4F"
android:text="@string/text5"
android:textSize="19sp" />
<Button
android:id="@+id/button6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_weight="1"
android:background="#2F4F4F"
android:text="@string/text6"
android:textSize="19sp" />
</LinearLayout>
</RelativeLayout> |
Je vous remercie d'avance à tous et un bon week end !