view遮挡住下面的videoview播放器

Amos80 2012-12-06 06:48:01
再做一个播放器,主界面activity layout中是一个videoview,想在点击屏幕时出现播放控制的界面,这个界面是用windowmanager给主界面添加的一个view,但是现在view出现之后就把下面的videoview遮住了,请问应该怎么解决啊,求指点,多谢!
...全文
407 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
A_G_E_N 2012-12-07
  • 打赏
  • 举报
回复
我知道有两种方法解决。一是用FrameLayout,另一个是PopupWindow,然后指定透明度。
fullscreenRL=(RelativeLayout)findViewById(R.id.FLBottom);
		fullscreenRL.getBackground().setAlpha(100);
		fullscreenRL.setVisibility(View.GONE);
//fullscreenRL.setVisibility(View.VISIBLE);

<FrameLayout 
        android:id="@+id/mainFL"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <com.jht.playvideo.VideoView android:id="@+id/fsSurface"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
        <RelativeLayout 
            android:id="@+id/FLBottom"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:background="@drawable/fullscreenbottombg">
            <SeekBar
            android:id="@+id/fsseekbar"
            android:layout_width="500dp"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:maxHeight="5dp"
            android:paddingLeft="5dp"
            android:paddingRight="5dp"
            android:progressDrawable="@drawable/fullseekbar"
            android:thumb="@drawable/fullseekbarslid"/>
            <TextView android:id="@+id/fulldurationtime"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_toLeftOf="@+id/fsseekbar"
                android:layout_centerVertical="true"/>
            <Button
                android:id="@+id/playorpausebtn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_toLeftOf="@+id/fulldurationtime"
                android:layout_marginRight="10dp"
                android:background="@drawable/suspendbtnstor"
                android:layout_centerVertical="true" />
            <TextView android:id="@+id/fulltotaltime"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_toRightOf="@+id/fsseekbar"
                android:layout_centerVertical="true"/>
            <ImageView
                android:id="@+id/soundimg"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_marginLeft="10dp"
                android:layout_toRightOf="@+id/fulltotaltime"
                android:background="@drawable/voice" />
            <SeekBar
                android:id="@+id/soundseekbar"
                android:layout_width="150dp"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_toRightOf="@+id/soundimg"
                android:maxHeight="5dp"
                android:paddingLeft="5dp"
                android:paddingRight="5dp"
                android:progressDrawable="@drawable/voicebarbg"
                android:thumb="@drawable/voiceslid" />
        </RelativeLayout>
    </FrameLayout>
Amos80 2012-12-06
  • 打赏
  • 举报
回复
引用 2 楼 wangduanqing5945 的回复:
视频播放器不都是盖住吗?但是你可以把背景的透明度变大点,这样就能看见下面的播放界面了,不至于啥也看不到了,体验不好!
我把view的背景设成#00000000了,但是还是背景全黑,把下面播放界面完全遮住了,还有什么好点的办法啊,或者是把控制界面用其他实现而不用覆盖一层view,前提是鼠标移动一下或者是点击一下他就出来,我是给电视上做的播放器,可以用鼠标键盘操作的。
Amos80 2012-12-06
  • 打赏
  • 举报
回复
引用 1 楼 wlcw16 的回复:
你是想把view放到什么位置?
我想把控制界面放到播放的上面,就像windows上的播放器一样,全屏播放时,鼠标移动到一个特定位置,然后控制播放的view就显示出来,但是view下面的播放器要能继续播放,而且能看到画面。
王端晴 2012-12-06
  • 打赏
  • 举报
回复
视频播放器不都是盖住吗?但是你可以把背景的透明度变大点,这样就能看见下面的播放界面了,不至于啥也看不到了,体验不好!
wlcw16 2012-12-06
  • 打赏
  • 举报
回复
你是想把view放到什么位置?

80,359

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧