0

我想在我的gridview下面有一個滑動抽屜,它是一個片段。根據屏幕大小我有兩個xml版本。較大的屏幕有兩個片段並排的小屏幕有一個片段。在碎片下面,我需要抽屜,但它隱藏了我的網格的底部元素。一些指針和幫助將會大受歡迎。
這就是我得到:變化 this is what i get滑動抽屜隱藏片段的最後一行GridView

我已經嘗試過而各種,這是我curently有:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       android:orientation="vertical" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:background="#ffffff"> 
    <FrameLayout 
      android:id="@+id/fragone" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 
      android:layout_marginLeft="0dp" 
      android:layout_alignParentTop="true" 
      android:layout_marginTop="0dp"> 
    </FrameLayout> 
     <SlidingDrawer 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:content="@+id/content" 
       android:handle="@+id/handle" 
       android:id="@+id/slidingDrawer" 
       android:layout_alignParentBottom="true" 
       android:layout_marginLeft="0dp" 
       android:layout_marginTop="0dp"> 
      <LinearLayout 
        android:id="@+id/content" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:padding="10dp" 
        android:background="#000000"> 

       <ListView android:layout_width="fill_parent" 
          android:layout_height="wrap_content" 
          android:id="@+id/lvDrawer" 
          android:divider="@android:color/transparent" 
          android:dividerHeight="10.0sp" /> 
      </LinearLayout> 

      <ImageButton 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:id="@+id/handle" 
        android:src="@drawable/fav_stern" 
        android:adjustViewBounds="true"/> 
     </SlidingDrawer> 

</RelativeLayout> 

第二個佈局應basicly是同一只用第二個片段在第一個的右邊。

+1

請注意SliderDrawer,因爲它已從API級別17棄用。 – Flynn81

+1

將'RelativeLayout'替換爲'LinearLayout',並且方向爲'vertical',然後看看會發生什麼 – Blundell

+0

@ Flynn81 thx,將會有什麼替代方法完全相同的功能?@Blundell thx也,我試過,但一點,但那隱藏我的gridview完整。還請閱讀文檔中的某處,您應該使用一個真正的佈局 – M4tchB0X3r

回答

0

按處理程序的高度偏移碎片的底部。一種方法是讓處理程序保持一致的高度並設置底部邊距。