Je développe une application Android en utilisant l'affichage de carte SupportMapFragment
la carte fonctionne très bien la question est textView
, je veux afficher un texte sur la MapFragment J'ai défini la mise en page comme ceci:android textview pas visible sur fragment de carte dans Android 4.4.2 mais visible dans le dispositif de sucettes
gpsTxtView=(TextView)findViewById(R.id.GPS);
définir le texte comme celui-ci:
gpsTxtView.setText("Last Halt: \n" + new SimpleDateFormat("MMM dd yyyy hh:mm:ss").format(date));
et le code XML pour cela:
`<FrameLayout
android:id="@+id/mapLL"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/tool_bar_detail"
layout="@layout/tool_bar_detail"
android:layout_width="match_parent"
android:layout_height="48sp" />
<fragment
android:id="@+id/detailMap"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:id="@+id/GPS"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|left"
android:layout_marginBottom="30sp"
android:layout_marginLeft="5sp"
android:text=""
android:textColor="@android:color/holo_red_dark"
android:textSize="16sp"
android:textStyle="bold" />
</FrameLayout> `
comme nous le faisons en général la chose que je ne pouvais pas comprendre pourquoi il ne fonctionne pas dans le 4.4.2 Android (Micromax Tab P480) et travailler dans Android Lollipop (yu Yureka) sera reconnaissant si quelqu'un suggère une solution pour cela. Merci.
ajoutez votre fichier de mise en page tout simplement pas 'TextView' –