Hai我试图将我的视图设置为xml中的 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="purhist-desc-col">
<h5>Heading Sample</h5>
<div class="purchase-price"></div>
<div>Example 1</div>
<div class="booking-hide-on-wholeday">00:00 Check-out 00:00</div>
<div>Example 2</div>
</div>
。仅当我第一次单击我的FAB plus时才会显示该视图,而当我再次单击它时将关闭该视图。我希望视图后面的所有内容都是选项卡,当视图可见时,操作栏无法单击/滑动或任何内容。所以我的问题是为什么我仍然可以点击并滑动选项卡,虽然我已经将视图的可点击设置为false?我的工作有什么问题吗?我怎样才能实现这一目标?请就此向我提出建议。谢谢!
xml:
clickable='false'
点击fab plus时调用的方法:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"
android:animateLayoutChanges="true">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay">
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabIndicatorColor="@android:color/white"
app:tabMode="scrollable">
<android.support.design.widget.TabItem
android:id="@+id/tab1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tab1" />
<android.support.design.widget.TabItem
android:id="@+id/tab2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tab2" />
</android.support.design.widget.TabLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_margin="10dp"
android:layout_below="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" >
</android.support.v4.view.ViewPager>
</RelativeLayout>
<View
android:id="@+id/shadowView"
android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#BFFFFFFF"
android:visibility="gone" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginRight="@dimen/fab_margin"
android:layout_marginBottom="@dimen/fab_margin"
app:srcCompat="@drawable/ic_add"
app:pressedTranslationZ="12dp"/>