我有一个MediaController,我希望它在右上角的位置,我使用方法SetAnchorView()跟随 我的布局
<RelativeLayout
android:id="@+id/content_media"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<VideoView
android:id="@+id/audio_play"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
和MyMediaController
VideoView video = (VideoView) findViewById(R.id.audio_play);
MediaController mc = new MediaController(this);
mc.setMediaPlayer(this);
mc.setAnchorView(video);
Run Code Online (Sandbox Code Playgroud)
但我的MediaController已经显示在顶部中心屏幕.Plese帮帮我.谢谢!