J'observe un comportement inattendu de Google Map. Problème: La carte est recadrée en haut et en bas à l'aide du Fragment de mappage de support, si j'utilise le plein écran, la carte est complètement visible comme illustré dans l'image 1, mais si j'applique des propriétés de hauteur ou de poids de fragment de carte, visible comme indiqué dans l'image 2.Android GoogleMap v2 recadré ou pas entièrement affiché
layout xml pour l'image 1:
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.paki.venturedive.awtest.MapsActivity" />
layout xml pour l'image 2:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.6"
tools:context="com.paki.venturedive.awtest.MapsActivity" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Hello world"
android:layout_weight="0.4" />
code Java:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
dans l'image 2, je suis (User sera) incapable de voir l'océan arctique au-dessus de la zone du Groenland, région de zone inférieure de la même sera absent, comme indiqué dans l'image 3 .
Est-ce que quelqu'un a été confronté à ce problème ou est-ce que quelqu'un sait comment le gérer?
Tout lien ou indice de référence sera apprécié.
postez votre fichier XML. code où vous avez défini la hauteur et la largeur. –
Question @SagarNayak éditée. –
comme vous donnez son poids à 0,6 alors la disposition linéaire ne donnera que 60% d'espace pour cartographier le fragment. dites-moi pourquoi donnez-vous du poids. et qu'est-ce que tu veux exactement? –