2013-02-28 7 views
1

tout ce que vous ajoutez au fichier xml pour permettre un flotteur imageview au-dessus d'une WebView ou la vue de la caméra etcAndroid SDK vue image flotte au-dessus WebView

<?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="match_parent" 
android:orientation="vertical" 
android:background="#e2e1e3" > 

<ImageView 
    android:id="@+id/imageView1" 
    android:layout_width="wrap_content" 
    android:layout_height="40dp" 
    android:src="@drawable/pm" 
    /> 

<WebView 
    android:id="@+id/webView1" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" /> 

</LinearLayout> 

Répondre

2

Vous devez utiliser une mise en page différente, comme FrameLayout ou RelativeLayout.

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="#e2e1e3" > 

    <WebView 
     android:id="@+id/webView1" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_centerInParent="true" /> 

    <ImageView 
     android:id="@+id/imageView1" 
     android:layout_width="wrap_content" 
     android:layout_height="40dp" 
     android:src="@drawable/pm" 
     android:layout_centerInParent="true" /> 

</RelativeLayout> 
+0

des thats causés à cacher quand mis dans le paysage, je voudrais que le imageview flotter au-dessus du WebView – MrJoshFisher

+0

@ M0n5terBunny, mon erreur. Je viens de faire une modification pour changer l'ordre z. – Phil

+0

comment pourrais-je mettre l'image dans le coin supérieur gauche – MrJoshFisher