2014-02-05 3 views
-1

나는 상대적 레이아웃 내에서 비디오보기를 구현했습니다. 내 상대적 레이아웃에 대해 layoutWidthlayoutHeight을 설정했으며 비디오보기에 대해 부모와 일치 시키려고합니다.안드로이드 자동 크기 조절에서 비디오보기 중지

제 문제는 비디오보기가 코드에 응답하지 않는 것입니다.

이 내 XML 뷰입니다 :

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="800dp" 
    android:layout_height="600dp" 
    android:background="@drawable/background" 
    android:orientation="vertical" > 

    <!-- Header --> 

    <include 
     android:id="@+id/include1" 
     layout="@layout/video_menu_header" /> 

    <VideoView 
     android:id="@+id/videoView1" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_below="@+id/include1" 
     android:layout_centerHorizontal="true" 
     /> 

</RelativeLayout> 

왜 VideoView를 지켜 보면서이 RelativeLayout의를 기입하지 않습니다?

+0

가능한 중복 : [크기 조정 VideoView를 지켜 보면서 (http://stackoverflow.com/questions/4434027/android-videoview-orientation-change-with-buffered-video/4452597#4452597) – BlueSword

+1

질문에 명확한 언급이 없습니다. "코드에 응답하지 않겠습니다."는별로 도움이되지 않습니다. 그 일이 무엇을하고 무엇을 기대하는지 명시하십시오. – jww

답변

0

해결책을 찾았습니다. 내가하려고했던 것은 relativeLayout 너비와 높이에 따라 videoView의 크기를 조정하는 것입니다. 나는에 코드를 수정 :

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="fill_parent" 
    android:layout_height="600dp" 
    android:background="@drawable/background" 
    android:orientation="vertical" > 

    <!-- Header --> 

    <include 
     android:id="@+id/include1" 
     layout="@layout/video_menu_header" /> 

    <VideoView 
     android:id="@+id/videoView1" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentRight="true" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_below="@+id/include1" 
     android:layout_centerHorizontal="true" 
     /> 

</RelativeLayout>