2015-11-30 46 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

我的意思是它一样,它挡住了我的按钮,它不应该做这种行为 –