2

android 스튜디오가있는 동영상보기 내부에 버튼을 표시하려면 어떻게해야하나요? 버튼이 보이지만 보이지 않는 것 같습니다.동영상보기 내부에 버튼 표시

<RelativeLayout> 

    <VideoView 
     android:id="@+id/vV" 
     android:layout_alignParentTop="true" 
     android:layout_alignParentEnd="true" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentStart="true" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentRight="true"/> 

    <Button 
     android:id="@+id/btn" 
     android:text="btn"/> 

</RelativeLayout> 

버튼이 동영상보기에 표시되도록하고 싶습니다. 버튼은 클릭 할 수 있지만 볼 수

답변

0

사용 구속 레이아웃

<?xml version="1.0" encoding="utf-8"?> 
<android.support.constraint.ConstraintLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/colorbackground"> 

    <VideoView 
     android:id="@+id/videoView" 
     android:layout_width="0dp" 
     android:layout_height="0dp" 
     android:layout_marginBottom="8dp" 
     android:layout_marginEnd="8dp" 
     android:layout_marginStart="8dp" 
     android:layout_marginTop="8dp" 
     app:layout_constraintBottom_toBottomOf="parent" 
     app:layout_constraintEnd_toEndOf="parent" 
     app:layout_constraintStart_toStartOf="parent" 
     app:layout_constraintTop_toTopOf="parent" /> 

    <Button 
     android:id="@+id/button" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginBottom="8dp" 
     android:layout_marginEnd="8dp" 
     android:layout_marginStart="8dp" 
     android:layout_marginTop="8dp" 
     android:text="Button" 
     app:layout_constraintBottom_toBottomOf="parent" 
     app:layout_constraintEnd_toEndOf="parent" 
     app:layout_constraintStart_toStartOf="parent" 
     app:layout_constraintTop_toTopOf="parent" 
     app:layout_constraintVertical_bias="0.8" /> 
</android.support.constraint.ConstraintLayout> 
+0

솔루션 작업 당신의 Gradle을에

implementation 'com.android.support.constraint:constraint-layout:1.0.2' 

를 추가하여? –