2014-09-19 81 views
0

我怎麼能適合seekBar留在抽屜邊界內?適合seekBar抽屜裏面

這是我drawerLayout

<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. --> 
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/drawer_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

    <ListView 
     android:id="@+id/left_drawer" 
     android:layout_width="240dp" 
     android:layout_height="match_parent" 
     android:layout_gravity="left" 
     android:background="#111" 
     android:choiceMode="singleChoice" 
     android:divider="@android:color/transparent" 
     android:dividerHeight="0dp" /> 

    <LinearLayout 
     android:id="@+id/right_drawer_ll" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_gravity="end" 
     android:orientation="vertical" 
     android:visibility="visible" > 

     <SeekBar 
      android:id="@+id/seekBar1" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" /> 

     <ListView 
      android:id="@+id/right_drawer" 
      android:layout_width="240dp" 
      android:layout_height="match_parent" 
      android:layout_gravity="right" 
      android:background="#123456" 
      android:choiceMode="singleChoice" 
      android:divider="@android:color/transparent" 
      android:dividerHeight="0dp" /> 
    </LinearLayout> 

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

與此代碼,搜索欄顯示的drawerLayout內,而不是rightDrawer邊界內。

UPDATE現在看起來 enter image description here

我希望這

enter image description here 是有可能實現這一目標?

在此先感謝。

+0

搜索條中示出了內部drawerLayout但不是rightDrawer邊界內。?你的意思是什麼? – 2014-09-19 11:34:42

+0

@HarshaVardhan查看問題更新。 – 2014-09-19 11:37:47

+0

@HarshaVardhan我希望seekBar留在右側的繪圖佈局中。 – 2014-09-19 11:39:19

回答

1

您沒有framelayout。所以,你的線性佈局取代了這一點。

修改烏爾佈局如下

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/drawer_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

    <FrameLayout 
     android:id="@+id/content_frame" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" > 
    </FrameLayout> 

    <ListView 
     android:id="@+id/left_drawer" 
     android:layout_width="240dp" 
     android:layout_height="match_parent" 
     android:layout_gravity="start" 
     android:background="#111" 
     android:choiceMode="singleChoice" 
     android:divider="@android:color/transparent" 
     android:dividerHeight="0dp" /> 

    <LinearLayout 
     android:id="@+id/right_drawer_ll" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_gravity="end" 
     android:background="@android:color/white" 
     android:orientation="vertical" 
     android:visibility="visible" > 

     <SeekBar 
      android:id="@+id/seekBar1" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginBottom="14dp" 
      android:layout_marginLeft="8dp" 
      android:layout_marginRight="10dp" 
      android:max="5" 
      android:progress="0" /> 

     <ListView 
      android:id="@+id/right_drawer" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_gravity="right" 
      android:background="#123456" 
      android:choiceMode="singleChoice" 
      android:divider="@android:color/transparent" 
      android:dividerHeight="0dp" /> 
    </LinearLayout> 

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

enter image description here

+0

錯誤關閉 – 2014-09-19 11:45:52

+0

這不是一個解決方案 – 2014-09-19 11:49:24

+0

Yokupoku Maioku,檢查圖像添加。這就是你要求的 – 2014-09-19 11:51:59