2015-11-30 45 views
1

爲什麼小吃吧覆蓋我的看法的Android - 小吃吧封面我查看

,這裏是我的xml用於顯示蛇棒

private CoordinatorLayout _CoordinatorLayout; 

@Override 
    public View onCreateView(LayoutInflater inflater, ViewGroup container, 
          Bundle savedInstanceState) { 

     View v = inflater.inflate(R.layout.compition, null); 

     _CoordinatorLayout = (CoordinatorLayout) v.findViewById(R.id.fullview); 

} 

Snackbar.make(_CoordinatorLayout , message , Snackbar.LENGTH_LONG).show(); 

這裏

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/fullview" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/dark_gray" 
    > 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical"> 

     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_weight="1"> 

      <TextView 
       android:id="@+id/reload" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_gravity="center" 
       android:gravity="center" 
       android:layout_centerInParent="true" 
       android:text="@string/reload" 
       android:visibility="visible" /> 

      <ProgressBar 
       android:id="@+id/progressbar" 
       style="?android:attr/progressBarStyleLarge" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerInParent="true" 
       android:gravity="center" 
       android:visibility="gone" /> 

      <android.support.v7.widget.RecyclerView 
       android:id="@+id/complist" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 

       android:layout_gravity="center" 

       android:fadeScrollbars="false" /> 
     </RelativeLayout> 


     <LinearLayout 
      android:id="@+id/buttons" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_gravity="bottom" 
      android:layout_margin="5dp" 
      android:orientation="horizontal"> 

      <Button 
       android:id="@+id/send" 
       android:layout_width="0dp" 
       android:layout_height="wrap_content" 
       android:layout_margin="5dp" 
       android:layout_weight="1" 
       android:background="@color/blue" 
       android:text="@string/send" 
       android:textColor="@android:color/white" /> 

      <Button 
       android:id="@+id/cancel" 
       android:layout_width="0dp" 
       android:layout_height="wrap_content" 
       android:layout_margin="5dp" 
       android:layout_weight="1" 
       android:background="@color/green" 
       android:text="@string/cancel" 
       android:textColor="@android:color/white" /> 
     </LinearLayout> 
    </LinearLayout> 
</android.support.design.widget.CoordinatorLayout> 

Java代碼截屏

enter image description here

我想念什麼?

+0

你可以張貼如何看起來圖像 – johnrao07

+0

@ johnrao07:從編輯歷史看來,您刪除其討論的圖像。 –

+0

其確定我再次添加 –

回答

0

documentation這裏說:

小吃店上面顯示在屏幕上的所有其他元素,只有一個可以 同時顯示。

所以,Snackbar會像烤麪包一樣覆蓋您的視野。

+0

沒有它不應該阻止我的按鈕,請看看https://www.google.com/design/spec/components/snackbars-toasts.html#snackbars-toasts-usage,它說不要阻塞浮動操作按鈕 –

+0

@MinaFawzy是因爲它顯示小吃吧,當移動它一點也不會阻止浮動按鈕。 –

+0

我的意思是它一樣,它擋住了我的按鈕,它不應該做這種行爲 –