我有一个带有android高级Web视图的浮动按钮,所有内容都能很好地显示,但是当我单击该浮动按钮时,它会将单击注册到Webview并更改页面。就像我在通过Web视图单击一样。
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="net.seekadventure.seekadventure.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
</android.support.design.widget.AppBarLayout>
<im.delight.android.webview.AdvancedWebView
android:id="@+id/newWeb"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
>
</im.delight.android.webview.AdvancedWebView>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_gravity="bottom|end"
android:layout_marginBottom="24dp"
android:layout_marginEnd="21dp"
android:src="@drawable/ic_share" />
<ProgressBar
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/loader"
android:layout_weight="1"
android:layout_gravity="center_vertical|center_horizontal|center"/>
</android.support.design.widget.CoordinatorLayout>
答案 0 :(得分:1)
尝试此操作使您的 FloatingActionButton
android:clickable="true"
android:focusableInTouchMode="true"
android:focusable="true"
示例代码
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_gravity="bottom|end"
android:layout_marginBottom="24dp"
android:layout_marginEnd="21dp"
android:clickable="true"
android:focusableInTouchMode="true"
android:focusable="true"
android:src="@drawable/ic_menu_send" />