2016-07-29 148 views
0

我對這個工作2天,但仍然沒有得到如何解決這個問題,在CoordinatorLayout只有FloatingActionButton正確固定,但我想在「查看」佈局應用錨,我「已經到目前爲止的工作,但鑑於被隱藏的視圖工具欄後面一半......請幫助..Thanks提前安卓CoordinatorLayout layout_anchor無法正確顯示

enter image description here

這裏是佈局

<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="com.rvsoftcorp.zetaride.MainActivity"> 
    <android.support.design.widget.AppBarLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:theme="@style/AppTheme.AppBarOverlay" 
    android:id="@+id/app_bar"> 
      <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="170dp" 
      android:background="?attr/colorPrimaryDark" 
      app:popupTheme="@style/AppTheme.PopupOverlay" 
      android:alpha="0.9"></android.support.v7.widget.Toolbar> 
    </android.support.design.widget.AppBarLayout> 
    <View 
    android:id="@+id/ntb_sample_5" 
    android:layout_width="100dp" 
    android:layout_height="50dp" 
    android:layout_margin="@dimen/fab_margin" 
    app:layout_anchor="@id/toolbar" 
    app:layout_anchorGravity="bottom|end"/ 

+0

發表完整的代碼,請。 – Mussa

+0

試試這個......'yourView.bringToFront();' –

+0

爲你的視圖添加高程;例如6dp。 – David

回答

0

查看ntb_sample應該是你佈局的android.support.design.widget.FloatingActionButton