2013-11-21 5 views
3

내 프로젝트에서 SlidingUpPanelLayout을 사용하는데 문제가 있습니다. My SlidingUpPanelLayout에는 2 명의 자식이 있습니다. 1) 데이터의 목록을 보여주는 ListView에 - 이것은 그의 아이들 (textvien, 글고, 버튼)을 만족 2)의 LinearLayout입니다 -이 SlidingUpPanelLayout 내가 내 버튼을 클릭하려고 보여주는 경우 패널을SlidingUpPanelLayout에서 하위 버튼을 클릭 할 수 없습니다.

을 위하고, 내 SlidingUpPanelLayout 즉시 닫고, 내 버튼과 edittext를 클릭 할 수 없습니다. 어떻게 이것을 제거 할 수 있습니까? 일부보기에서 어떻게 패널을 클릭/표시 할 수 있습니까?

감사합니다.

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
    <com.sothree.slidinguppanel.SlidingUpPanelLayout 
     android:id="@+id/sliding_layout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" >   
     <ListView    
      android:paddingLeft="10dp" 
      android:paddingRight="10dp" 
      android:divider="@drawable/shape_divider_comments" 
      android:dividerHeight="1dp" 
      android:id="@+id/lvReviews" 
      android:visibility="gone" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" > 
     </ListView> 
     <LinearLayout 
      android:id="@+id/rlSlidingContent" 
      android:gravity="center|top" 
      android:orientation="vertical" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" >    
      <ScrollView 
       android:visibility="visible" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" > 
        <LinearLayout 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         android:orientation="vertical">      
         <EditText 
          style="@style/StyleEditText" 
          android:id="@+id/etPersonName" 
          android:layout_width="match_parent" 
          android:layout_height="wrap_content" 
          android:ems="10" 
          android:hint="@string/your_name_hint" 
          android:inputType="textPersonName" > 

         </EditText>             
         <Button 
          style="@style/StyleButton" 
          android:visibility="visible" 
          android:id="@+id/btnAddComment" 
          android:layout_gravity="center" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:text="Add" /> 
        </LinearLayout> 
       </ScrollView> 
     </LinearLayout> 
    </com.sothree.slidinguppanel.SlidingUpPanelLayout> 
</RelativeLayout> 

답변

2

방법을 확인하십시오. setDragView은 서랍의 "핸들"을 나타냅니다. 또한 , 귀하의 의견의 오버 드로을 확인, 당신은 예를 들어, 레이아웃, 을 단순화 수 :

<com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/sliding_layout" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<ListView 
    android:id="@+id/lvReviews" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:divider="@drawable/shape_divider_comments" 
    android:dividerHeight="1dp" 
    android:paddingLeft="10dp" 
    android:paddingRight="10dp" 
    android:visibility="gone" /> 

<ScrollView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fillViewport="true" 
    android:visibility="visible"> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical"> 

     <EditText 
      android:id="@+id/etPersonName" 
      style="@style/StyleEditText" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:ems="10" 
      android:hint="@string/your_name_hint" 
      android:inputType="textPersonName"> 

     </EditText> 

     <Button 
      android:id="@+id/btnAddComment" 
      style="@style/StyleButton" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center" 
      android:text="Add" 
      android:visibility="visible" /> 
    </LinearLayout> 
</ScrollView> 

</com.sothree.slidinguppanel.SlidingUpPanelLayout> 

은 훨씬 덜

+0

감사 답변을 많이 오버 드로와 같은 렌더링합니다. 그것은 작동합니다! setDragView 메서드를 잊어 버렸습니다. – Denis

+0

어떻게 setDragView에 액세스 할 수 있습니까? –

관련 문제