【发布时间】:2017-03-28 21:28:23
【问题描述】:
我有一个FrameLayout,在FrameLayout里面我有两个视图,一个是ViewPager,另一个是LinearLayout,LinearLayout就像一个窗口,所以它有一些按钮.我使用可见性属性显示和隐藏LinearLayout。问题是当我显示LinearLayout 时,它覆盖了ViewPager,但用户仍然可以在ViewPager 内滚动ListView。我想阻止所有点击事件到后面的视图。
XML 看起来像这样:
<LinearLayout 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:background="@color/colorBeige"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar_diner_food"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/white"
android:contentInsetLeft="0dp"
android:contentInsetStart="0dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:titleTextColor="@android:color/white"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout_diner_food"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:background="@android:color/white"/>
<android.support.v4.view.ViewPager
android:id="@+id/view_pager_diner_food"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:id="@+id/linea_layout_filter"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorBlackAlpha">
<com.wonderkiln.blurkit.BlurLayout
android:id="@+id/blurLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="true"
android:orientation="vertical">
<SeekBar
android:id="@+id/seek_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="61dp"/>
</LinearLayout>
</com.wonderkiln.blurkit.BlurLayout>
</LinearLayout>
</FrameLayout>
【问题讨论】:
-
我在你的问题中编辑的代码对你有用,我也为你的问题编辑了我的答案并查看了
-
让我知道这是否有效
-
@NarendraSorathiya 没用。
标签: android layout click android-framelayout