在android中是否可以将覆盖视图放置在youtube播放器视图中?

在android中是否可以将覆盖视图放置在youtube播放器视图中?,android,overlay,android-youtube-api,Android,Overlay,Android Youtube Api,在我的情况下,在上面的youtube播放器视图中设置textview。我得到的错误类似于未经授权的覆盖。是否可以在youtube播放器视图中覆盖该视图 下面是我的代码 <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TextView and

在我的情况下,在上面的youtube播放器视图中设置textview。我得到的错误类似于未经授权的覆盖。是否可以在youtube播放器视图中覆盖该视图

下面是我的代码

<FrameLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">


    <TextView
        android:id="@+id/txt_attach"
        android:layout_width="120dp"
        android:layout_height="35dp"
        android:gravity="center"
        android:textSize="15dp"
        android:textColor="#ffffff"
        android:layout_marginTop="100dp"


        android:visibility="visible"
        android:text="Attach"/>

  <fragment
      android:id="@+id/player_fragment"
      android:name="com.google.android.youtube.player.YouTubePlayerFragment"
      android:layout_width="wrap_content"
      android:layout_marginTop="50dp"
      android:layout_height="wrap_content"
     />


</FrameLayout>

尝试在framelayout中添加youtube播放器和文本视图

<FrameLayout
   android:layout_width="wrap_content"
   android:layout_height="wrap_content">

   <TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:id="@+id/text"
      android:padding="@dimen/four_dp"
      android:Text="text view" />

  <YouTubePlayer
      android:id="@+id/player"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content" />

在您的活动中,获取视图并调用
text.bringToFront()
可能会出现错误,但我确信可以解决它们


希望这将对您有所帮助

谢谢您的回复,但在我的情况下,它不起作用。请查看我编辑的问题。由于未经授权的覆盖在播放机顶部,我将停止播放错误liike YouTube视频。YouTubePlayerView被android.widget.TextView{1ba6139 V.ED..0200-240270#7f060002应用程序:id/txt_attach}遮挡。该视图位于YouTubePlayerView内部,模糊视图和YouTubePlayerView之间的距离(以px为单位)为:左:0,上:100,右:480,下:235..您需要检查@sebastiano answer,希望这对您有所帮助。因为我现在不能测试这些东西,但稍后我会测试并让你知道