1

您添加到 xml 文件中的所有内容以允许 imageview 浮动在 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>
4

1 回答 1

2

您需要使用不同的布局,例如FrameLayoutRelativeLayout

<?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>
于 2013-02-28T20:41:25.497 回答