2011-10-20 8 views
2

ビデオにカーソルを合わせると、ナビゲーションバーが表示されますが、中央には配置されません。ここに私のxmlとスクリーンショットです:VideoView Androidのセンタービデオ再生ボタンバー

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="#00ffffff"> 
    <VideoView 
    android:id="@+id/videoPlayer" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_centerInParent="true"/> 
    <ImageView 
    android:id="@+id/video_close_btn" 
    android:layout_width="36dp" 
    android:layout_height="36dp" 
    android:layout_alignTop="@id/videoPlayer" 
    android:layout_alignRight="@id/videoPlayer" 
    android:src="@drawable/close_button" 
    android:scaleType="fitXY"/> 
</RelativeLayout> 

enter image description here

答えて

0

これは動作するはずです:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="#00ffffff"> 
    <VideoView 
    android:id="@+id/videoPlayer" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_centerInParent="true"/> 
    <ImageView 
    android:id="@+id/video_close_btn" 
    android:layout_width="36dp" 
    android:layout_height="36dp" 
    android:layout_centerInParent="true" 
    android:src="@drawable/close_button" 
    android:scaleType="fitXY"/> 
</RelativeLayout> 
関連する問題