VideoView 위에 버튼을 숨기고 표시하는 데 문제가 있습니다. 단순함을 위해 나는 xml 파일을 가지고 있는데, 실제 파일은 훨씬 더 많은 버튼을 가지고있다. 나는 동영상을 재생할 때 VideoView 뒤에 붙어서 보임
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<VideoView
android:id="@+id/videoEnter"
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"
android:scaleType="fitXY" />
<Button
android:id="@+id/play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Play" />
</RelativeLayout>
는 기본적으로 나는
View.INVISIBLE
에있는 버튼을 설정하고 비디오
onCompletion
에 완료 될 때 나는
View.Visible
에있는 버튼을 설정합니다. 문제는 버튼을 클릭 할 수 있지만 VideoView 뒤에 있으며 보이지 않는다는 것입니다. FrameLayout에서이 작업을 수행 할 수 있었지만, RelativeLayout에서만 작업 할 수있는 화면에 맞게 videoview를 늘려야합니다. RelativeLayout에서이 모든 작업을 수행 할 여지가 있습니까?
나는 또한 .bringToFront()
을 시도했지만 성공하지 못했습니다. 도움에 미리
덕분에
버튼을 먼저 선언하면 어떻게됩니까? – Sam
그냥 주위를 전환 해 보았습니다. 변경된 유일한 점은 처음에 VideoView 위에있는 것이 아니라 처음에 VideoView가 해당 버튼을 덮고 있다는 것입니다. 나는 여전히 버튼을 클릭 할 수 있습니다, 그것은 단지 보이지 않습니다. – Jacob
이전에 가지고 있던 FrameLayout 솔루션을 사용하여 RelativeLayout (화면에 맞게 늘어남) 내에서 FrameLayout을 래핑하고 부모와 일치 시키려고 했습니까? 또한 VideoView와 Button을 제거하고 다시 팽창 시키려고 했습니까? 그리고 ... 버튼에 View.GONE을 사용해 보셨습니까? –