2016-03-15 61 views
0

我使用recyclerview是循環的圖像,但它開始的動作條的後面,如下圖所示。我想要的形象出現以下開始行動吧。我試着用以下的Android佈局,但仍然沒有。任何解決方案傢伙謝謝 !!!!Android的工作室:我怎樣才能把圖像在動作條的底部?

Image of the application

activity_main.xml中

<?xml version="1.0" encoding="utf-8"?> 
    <android.support.v4.widget.DrawerLayout 
    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:id="@+id/drawer" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true" 
    tools:openDrawer="start"> 

    <android.support.design.widget.CoordinatorLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true" 
    tools:context=".activity.MainActivity"> 


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

    <android.support.design.widget.AppBarLayout 
     android:id="@+id/main_toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:theme="@style/AppTheme.AppBarOverlay"> 

     <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.design.widget.AppBarLayout> 



    <android.support.design.widget.FloatingActionButton 
     android:id="@+id/fab2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginBottom="160dp" 
     android:layout_gravity="bottom|end" 
     android:layout_marginRight="@dimen/fab_margin" 
     android:visibility="invisible" 
     app:backgroundTint="@color/colorFAB2" 
     app:elevation="6dp" 
     app:pressedTranslationZ="12dp" 
     android:src="@drawable/ic_android_black_24dp" /> 
    <android.support.design.widget.FloatingActionButton 
     android:id="@+id/fab1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginBottom="90dp" 
     android:layout_gravity="bottom|end" 
     android:layout_marginRight="@dimen/fab_margin" 
     android:visibility="invisible" 
     app:elevation="6dp" 
     app:backgroundTint="@color/colorFAB1" 
     app:pressedTranslationZ="12dp" 
     android:src="@drawable/ic_android_black_24dp" /> 
    <android.support.design.widget.FloatingActionButton 
     android:id="@+id/fab" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="bottom|end" 
     app:elevation="6dp" 
     app:backgroundTint="@color/colorAccent" 
     app:pressedTranslationZ="12dp" 
     android:layout_margin="@dimen/fab_margin" 
     android:src="@drawable/ic_add_white_24dp" /> 
    </android.support.design.widget.CoordinatorLayout> 




    <android.support.design.widget.NavigationView 
    android:id="@+id/navigation_view" 
    android:layout_height="match_parent" 
    android:layout_width="wrap_content" 
    android:layout_gravity="start" 
    app:headerLayout="@layout/nav_header" 
    app:menu="@menu/menu_navigation"/> 






</android.support.v4.widget.DrawerLayout> 

Content_main.xml

<?xml version="1.0" encoding="utf-8"?> 

    <com.balysv.materialripple.MaterialRippleLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/lyt_parent" 
    style="@style/RippleStyleWhite" 
    android:layout_width="match_parent" 
    android:layout_height="150dp" 
    android:layout_margin="@dimen/spacing_medium" 
    > 



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



     <ImageView 
      android:id="@+id/img_android" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:scaleType="centerCrop" 
      android:src="@drawable/black_bg" /> 

     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:background="@drawable/shape_overlay" 
      android:padding="10dp"> 


      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:gravity="center_vertical" 
       android:orientation="horizontal"> 

      </LinearLayout> 

      <TextView 
       android:id="@+id/tv_android" 
       android:layout_width="0dp" 
       android:layout_weight="1" 
       android:layout_height="wrap_content" 
       android:text="Sample Title" 
       android:gravity="center" 
       android:textAppearance="@style/TextAppearance.AppCompat.Title" 
       android:textColor="@android:color/white" 
       android:textStyle="normal" 
       android:layout_centerVertical="true" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" 
       android:layout_alignParentRight="true" 
       android:layout_alignParentEnd="true" /> 


      </RelativeLayout> 
     </RelativeLayout> 
    </com.balysv.materialripple.MaterialRippleLayout> 

回答

0

您是否嘗試過增加保證金頂到RecyclerView?

<android.support.v7.widget.RecyclerView 
     android:id="@+id/card_recycler_view" 
     android:layout_marginTop="?android:attr/actionBarSize" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"/> 
+0

謝謝!!!!有效 ! –

相關問題