enter image description here OK J'ai donc créé fragment_googlemap.xml et j'ai conçu FrameLayout en tant que mise en page racine car j'avais besoin de mapView en tant que fragment. Coupé à la poursuite, ce que je voulais être arrivé est que pour montrer Spinner et Floating Action Button sur le dessus de google map. Mais quand je lance l'application, je ne peux pas voir les enfants de relativelayout (bouton spinner et flottant). Je pense que c'est sous googlemapview parce que je peux les voir sous googlemap pendant une seconde lors du chargement. Une solution pour cela?Mon Relativelayout ne s'affichera pas sous FrameLayout
ooohh et BTW Je ne sais pas pourquoi la valeur de l'attribut élévation bouton flottant ne fonctionne pas idée s'il vous plaît ????
Désolé si mon anglais est pauvre :(Et Thx à l'avance !!!
======= ici est mon code source de fichier XML ci-dessous ===========
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:fab="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<Spinner
android:id="@+id/spinner_countries"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/fab"
android:layout_below="@+id/fab"
android:entries="@array/location_arraysResc" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_gravity="end|top"
android:layout_margin="10dp"
android:backgroundTint="@color/colorPrimary"
android:elevation="6dp"
android:src="@drawable/paperplane"
android:tint="#000000"
app:borderWidth="0dp"
app:rippleColor="#eF43ef" />
</RelativeLayout>
<com.google.android.gms.maps.MapView
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.google.android.gms.maps.MapView>
</FrameLayout>
Mise en page Frame doit avoir seulement 1 enfant. Mettez votre mise en page relative et la carte dans une autre disposition avant de mettre en framelayout. – Lcukerd
In Frame Layout Les vues enfant sont dessinées dans une pile, avec le dernier enfant ajouté en haut. Donc, dans votre cas, l'enfant récemment ajouté est mapview, c'est pourquoi votre spinner et votre bouton flottant sont derrière votre carte. Inversez l'ordre et tout ira bien. –
quelle serait la meilleure mise en page? pour les mettre ensemble? – poream3387