android - 如何在 Android 上向 Webview 添加按钮?

标签 android webview

我正在以编程方式生成一个 webview 我想在 webview 上添加一个按钮。我可以添加一个普通按钮,但它位于 webview 之前,而不是在它之上。

有没有办法在 webview 上添加按钮?

最佳答案

Use like this ...

      <FrameLayout 
         android:layout_width="fill_parent"
         android:layout_height="500dp"
         android:layout_weight="1"
                >
            <WebView
                android:id="@+id/main_web "
                android:layout_width="fill_parent"
                android:layout_height="500dp"
                android:layout_weight="1" />

                 <ImageButton
                    android:id="@+id/refresh"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="right"
                  ></ImageButton>
        </FrameLayout>

关于android - 如何在 Android 上向 Webview 添加按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6723070/

相关文章:

java - 如何在不输入activity.class等Android系统文件的情况下调试程序

java - 如何在android中找到特定的数据库和表是否已经存在

android - 如何在混合应用程序中安全地创建登录系统(phonegap/cordova)

Android清除webview线程,释放内存,避免OutOfMemoryError

android - onProgressChanged 在繁重的网站上没有达到 100%

java - (android studio)无法更改webview中的 "Webpage not available"页面

java - 通过 id 查找布局

java - 2 IntentServices 访问文件系统上的相同数据..安全吗?

android - 在Flutter中选择包含ListTile()的Card()

c# - xamarin 表单 - webview 不安全连接 http