我有一个视频视图。当我触摸它时,它应该显示在一个几乎全屏视图的对话框中。为此,我使用了以下代码:
mVideoFirst.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
mVideoFirst.stopPlayback();
mVideoDialog.show();
mVideoFullScreen.setVideoPath(clip1.getAbsolutePath());
mMediaController3.setMediaPlayer(mVideoFullScreen);
mVideoFullScreen.setMediaController(mMediaController3);
mVideoFullScreen.requestFocus();
mVideoFullScreen.start();
return false;
}
});
对于对话框,我使用了以下 java 代码:
mVideoDialog = new Dialog(this);
mVideoDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
mVideoDialog.setContentView(R.layout.fullscreen_video);
mVideoDialog.setOnKeyListener(this);
mVideoFullScreen = (VideoView) mVideoDialog.findViewById(R.id.fullscreen_videoview);
这是我对对话框的 xml 恶意代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<VideoView
android:id="@+id/fullscreen_videoview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true" >
</VideoView>
</RelativeLayout>
现在的问题是,视频正在对话框中播放。但是视频出现在对话框的右侧。对话框左侧有很多空白区域。控制器隐藏在对话框后面。所以我无法使用视频控制器控制视频,因为我无法触摸它。
谁能帮我..