2013-02-05 2 views
0

내 견해 아래에 표시되는 슬라이딩 서랍을 갖고 싶지만 현재 표시되지 않습니다. 나는 또한 선형보기를 사용하여 루트보기의 스크롤보기가 1의 가중치를 가졌지 만 스크롤보기와 그 내용이 표시되지 않도록했습니다. 어떤 아이디어?슬라이딩 서랍이 표시되지 않음

내보기 :

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" > 

<ScrollView 
    android:id="@+id/scrollLayout" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" > 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     tools:context=".AddScheduleItemActivity" > 

     . 
     . 
     . 

    </LinearLayout> 
</ScrollView> 

<SlidingDrawer 
    android:id="@+id/slidingDrawer1" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_below="@+id/scrollLayout" 
    android:content="@+id/content" 
    android:handle="@+id/handle" > 

    <Button 
     android:id="@+id/handle" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Handle" /> 

    <LinearLayout 
     android:id="@+id/content" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" > 

     <Button 
      android:id="@+id/hadsfndle" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="sdf" /> 
    </LinearLayout> 
</SlidingDrawer> 

감사합니다, 나는 파란색 스크롤보기 및 내용과 될 수있는 녹색으로하려는 사진에서 나단

How it should look

슬라이더의 핸들

몇 가지 다른 제안을 시도해 본 결과 아직 시도되지 않는이 문제가 발생했습니다. 스크롤 뷰의 내용은 훌륭하게 표시되지만 슬라이더는 표시되지 않습니다. 더 많은 제안이 필요합니다! 감사!

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:layout_gravity="bottom" 
android:gravity="bottom" 
android:orientation="vertical" > 

<ScrollView 
    android:id="@+id/scrollLayout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

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

     . 
     . 
     . 

    </RelativeLayout> 
</ScrollView> 

<SlidingDrawer 
    android:id="@+id/slidingDrawer1" 
    android:layout_width="match_parent" 
    android:layout_height="50dip" 
    android:layout_alignParentBottom="true" 
    android:layout_below="@+id/scrollLayout" 
    android:content="@+id/content" 
    android:handle="@+id/handle" 
    android:orientation="vertical" > 

    <Button 
     android:id="@+id/handle" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Handle" /> 

    <LinearLayout 
     android:id="@+id/content" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" > 

     <Button 
      android:id="@+id/hadsfndle" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="sdf" /> 
    </LinearLayout> 
</SlidingDrawer> 

</RelativeLayout> 

음이

SlidingDrawerlayout_alignParentBottom 추가, 서랍 슬라이딩하는 것은 더 이상 내가 대안 :(

+0

당신은 당신이 당신의 슬라이더를 원하는 위치에 정확히 알려 주시기 바랍니다 수 있습니까? 화면 하단이나 화면 상단에 있습니까? 귀하의 레이아웃과 바닥에 표시 슬라이더를 테스트하고 아래에서 위로 열립니다. – GrIsHu

+0

나는 그것을 바닥에서 원해. 게시 한 레이아웃을 사용하면 선형 레이아웃에 아무 것도 없기 때문에 슬라이더를 볼 수 있습니다. 화면의 공간을 초과 할 때까지 많은 수의 요소를 추가하십시오. 이 시점에서 스크롤 뷰는 슬라이더 핸들을 화면 밖으로 밀어냅니다. – Nath5

답변

0

이 시도를 찾을 것 같아요 그래서 지원되는지 나타납니다.

android:layout_alignParentBottom="true" 
+0

불행히도 그것은 작동하지 않았다. 다른 아이디어? – Nath5

+0

화면을 표시 할 수 있습니까? 원하는 방식 – MuraliGanesan

1

슬라이더를 아래쪽에 표시하려면 아래 코드를 시도하십시오.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    > 

    <ScrollView 
     android:id="@+id/scrollLayout" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" > 

     <LinearLayout 
      android:id="@+id/layout" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:orientation="vertical" > 


     </LinearLayout> 
    </ScrollView> 

    <LinearLayout 
     android:id="@+id/LinearLayout01" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_below="@+id/layout" 
     android:orientation="vertical" > 

     <SlidingDrawer 
      android:id="@+id/SlidingDrawer" 
      android:layout_width="wrap_content" 
      android:layout_height="250dip" 
      android:content="@+id/contentLayout" 
      android:handle="@+id/slideHandleButton" 
      android:padding="10dip" > 

      <Button 
       android:id="@+id/slideHandleButton" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:background="@drawable/ic_launcher" > 
      </Button> 

      <LinearLayout 
       android:id="@+id/contentLayout" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:background="#C0C0C0" 
       android:gravity="center|top" 
       android:orientation="vertical" 
       android:padding="10dip" > 

       <Button 
        android:id="@+id/Button01" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="Content" > 
       </Button> 

       <Button 
        android:id="@+id/Button02" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="Content" > 
       </Button> 

       <Button 
        android:id="@+id/Button03" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="Content" > 
       </Button> 
      </LinearLayout> 
     </SlidingDrawer> 
    </LinearLayout> 

</RelativeLayout> 

위의 코드로 문제가 해결되지 않으면 부모 레이아웃을 LinearLayout으로 변경하고 이라고 입력 한 다음 scrollview & sliderDrawer 개로 배포하십시오.

+0

이 옵션 중 어느 것도 작동하지 않습니다. – Nath5

0

아마도 귀하의 질문은 이미 대답 here되었습니다.

이 시도 :

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
> 

<ScrollView 
    android:id="@+id/scrollLayout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

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

     . 
     . 
     . 

    </RelativeLayout> 
</ScrollView> 

<SlidingDrawer 
    android:id="@+id/slidingDrawer1" 
    android:layout_width="match_parent" 
    android:layout_height="50dip" 
    android:layout_alignParentBottom="true" 
    android:content="@+id/content" 
    android:handle="@+id/handle" 
    android:orientation="vertical" > 

    <Button 
     android:id="@+id/handle" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Handle" /> 

    <LinearLayout 
     android:id="@+id/content" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" > 

     <Button 
      android:id="@+id/hadsfndle" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="sdf" /> 
    </LinearLayout> 
</SlidingDrawer> 

</RelativeLayout> 
관련 문제