2014-12-29 10 views
0

AndroidSlidingUpPanel을 사용 중이며 VideoView 슬라이딩 레이아웃에 있습니다. 그래서 코드에서, 나는 (슬라이딩 레이아웃을 축소 및 확대) 드래그 영역을 정의하기 위해 다음과 같은 라인을 사용하고 있습니다 :ScrollView의 VideoView가 AndroidSlidingUpPanel에서 작동하지 않습니다.

SlidingUpPanelLayout layout = (SlidingUpPanelLayout) 
    findViewById(R.id.sliding_layout); 
    layout.setDragView(findViewById(R.id.main_title_bar)); 
    layout.setEnableDragViewTouchEvents(true); 

및 XML 코드 :

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="#FFFFFF" 
    tools:context=".VideoMapPanel" > 

    <com.sothree.slidinguppanel.SlidingUpPanelLayout 
     xmlns:sothree="http://schemas.android.com/apk/res-auto" 
     android:id="@+id/sliding_layout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:gravity="bottom" 
     sothree:panelHeight="68dp" 
     sothree:shadowHeight="4dp" 
     sothree:paralaxOffset="100dp" 
     sothree:dragView="@+id/dragView" 
     > 

     <!-- MAIN CONTENT --> 
     <FrameLayout 

      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:orientation="vertical"> 
      <android.support.v7.widget.Toolbar 
       xmlns:sothree="http://schemas.android.com/apk/res-auto" 
       xmlns:android="http://schemas.android.com/apk/res/android" 
       android:id="@+id/main_toolbar" 
       android:layout_height="?attr/actionBarSize" 
       android:background="?attr/colorPrimary" 
       sothree:theme="@style/ActionBar" 
       android:layout_width="match_parent"/> 
      <TextView 
       android:id="@+id/main" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_marginTop="?attr/actionBarSize" 
       android:gravity="center" 
       android:text="Main Content" 
       android:clickable="true" 
       android:focusable="false" 
       android:focusableInTouchMode="true" 
       android:textSize="16sp" /> 



       <fragment 
     android:id="@+id/map" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     class="com.google.android.gms.maps.MapFragment" /> 

     </FrameLayout> 

     <!-- SLIDING LAYOUT --> 
     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:background="#eeeeee" 
      android:orientation="vertical" 
      android:clickable="true" 
      android:focusable="false" 
      android:id="@+id/dragView"> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="68dp" 
       android:id="@+id/main_title_bar" 
       android:orientation="horizontal"> 

       <TextView 
        android:id="@+id/tvName" 
        android:layout_width="0dp" 
        android:layout_height="match_parent" 
        android:layout_weight="1" 
        android:textSize="20sp" 
        android:textColor="@android:color/black" 
        android:textStyle="bold" 
        android:gravity="center_vertical" 
        android:paddingLeft="10dp"/> 

         <ProgressBar 
      android:id="@+id/progressBar" 
      style="?android:attr/progressBarStyleLarge" 
      android:layout_width="50dip" 
      android:layout_height="match_parent" 
      android:gravity="center_vertical" 
      android:visibility="gone" > 
     </ProgressBar> 

        <ImageView 
        android:id="@+id/tvLogo" 
        android:layout_width="50dip" 
        android:layout_height="match_parent" 
        android:paddingRight="10dp" 
        android:gravity="center_vertical" /> 

      </LinearLayout> 



      <LinearLayout 
       android:id="@+id/menuLayout" 
       android:layout_width="match_parent" 
       android:layout_height="68dp" 
       android:orientation="horizontal"> 



            <ImageButton 
        android:id="@+id/fbLogo" 
        android:layout_width="fill_parent" 
        android:layout_height="match_parent" 
        android:layout_weight="0.8" 
        android:src="@drawable/facebook_logo" 
        /> 


         <ImageButton 
        android:id="@+id/twitterLogo" 
        android:layout_width="fill_parent" 
        android:layout_height="match_parent" 
        android:layout_weight="0.8" 
        android:src="@drawable/twitter_logo" 
        /> 



              <ImageButton 
        android:id="@+id/webLogo" 
        android:layout_width="fill_parent" 
        android:layout_height="match_parent" 
        android:layout_weight="0.8" 
        android:src="@drawable/web_logo" 
        />  



      </LinearLayout> 


<ScrollView 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" > 


      <RelativeLayout 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="#FFFFFF" 
    android:clickable="true" 
    android:id="@+id/tvDescriptionLayout" 
    android:layout_gravity="center" > 


         <com.myapp.ex.ExpandableTextView 
        android:id="@+id/tvDescription" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:textSize="14sp" 
        android:textColor="@android:color/black" 
        android:gravity="center_vertical" 
        android:paddingTop="10dp" 
        android:paddingLeft="10dp" 
        android:paddingRight="10dp"/> 


    <VideoView 

     android:id="@+id/liveView" 
     android:clickable="true" 
     android:paddingLeft="10dp" 
     android:paddingRight="10dp" 
     android:layout_below="@id/tvDescription" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center"/> 

    </RelativeLayout>  

    </ScrollView>  

</LinearLayout> 
</com.sothree.slidinguppanel.SlidingUpPanelLayout> 

</RelativeLayout> 

문제를 콘텐츠가 스크롤하려고 할 때 ScrollView이 작동하지 않고 비디오가 VideoView에 표시되지 않습니다.

+0

확인 : http://stackoverflow.com/questions/22478361/slidinguppanellay-and-scrollview –

답변

관련 문제