Android SDK ImageView float 在 webview 之上

标签 android sdk

你添加到 xml 文件中的所有内容以允许 imageview float 在 webview 或相机 View 等之上

<?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>

最佳答案

您需要使用不同的布局,例如 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>

关于Android SDK ImageView float 在 webview 之上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15145201/

相关文章:

java - 清除 Activity 堆栈

android - 使用 NDK,std::fstream open() 失败,而 fopen() 正常工作,为什么?

android - 不能刷webview?

Android SDK 管理器无法在 Windows 8 x64 上获取存储库

c# - 如何从 C# 访问 SDK?

java - 如何在 Linux 上的 Intellij 中正确一步步安装 java 和 javafx?

android - 我的doOnComplete在.Map完成之前被调用

android - BuildConfig.java中的意外更改,无法还原

azure - Visual Studio 2013 上的错误 160 WAT080 : Failed to locate the Windows Azure SDK 2. 3

python - 如何在 swarm 上下文中使用 docker python SDK?