LinearLayout API Google Maps
Bonjour à tous,
J'aimerai réaliser une vue en la découpant en 3 parties de haut en bas.
1ere partie : 3 boutons alignés dans un layout qui fait 25% de haut.
2e partie : ma carte Google Maps sur 50% de hauteur
3e partie : des informations relatives à mon application sur 25% de haut.
Cependant avec la configuration de mon main.xml, je n'arrive pas du tout à ce resultats et je pense que cela est dut au comportement de ma carte Google Maps.
Au final, je me retrouve avec ma partie haute qui fait la hauteur de mes boutons, soit 10% de la hauteur de mon ecran.
Ma carte Google Maps prend le reste de la place sur le bas.
Ma derniere partie est donc invisible.
Je vous fournis le code XML
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
|
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:weightSum="1.0">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="#2fb9c0"
>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<Button
android:id="@+id/btnStartTrack"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Start"
/>
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<Button
android:id="@+id/btnStopTrack"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Stop"
/>
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<Button
android:id="@+id/btnClearTrack"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Clear"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:background="#aa2fc0">
<com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="@string/mapKey"
/>
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="#66c02f"
>
</LinearLayout>
</LinearLayout> |
J'ai essayé différentes configuration mais impossible d'avoir le rendu désiré.
Je vous remercie d'avance.