2014-09-19 5 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> 

, 검색 막대가 아니라 rightDrawer 경계 내부의 drawerLayout 내부에 표시된다.

UPDATE 지금은 이것을 달성 할 수 enter image description here

내가 본

enter image description here 을 해보 게? 사전에

감사합니다.

+0

에서 SeekBar가 drawerLayout 내부의 표시가 아니라 rightDrawer의 경계 내에 다음과 같이

통해 UR 레이아웃을 수정합니다.? 정확히 무슨 말이야? –

+0

@HarshaVardhan 질문 업데이트를 참조하십시오. –

+0

@HarshaVardhan seekBar가 rightDrawer 레이아웃 안에 있어야합니다. –

답변

1

프레임 레이 아웃이 없습니다. 그래서, ur linearlayout이 그 대신에 취했습니다.

<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

틀린 닫기 –

+0

이것은 해결책이 아닙니다 –

+0

요코 포쿠 마이 오쿠, 추가 된 이미지를 확인하십시오. 이것은 당신이 요구 한 것입니다. –