再做一个播放器,主界面activity  layout中是一个videoview,想在点击屏幕时出现播放控制的界面,这个界面是用windowmanager给主界面添加的一个view,但是现在view出现之后就把下面的videoview遮住了,请问应该怎么解决啊,求指点,多谢!

解决方案 »

  1.   

    我想把控制界面放到播放的上面,就像windows上的播放器一样,全屏播放时,鼠标移动到一个特定位置,然后控制播放的view就显示出来,但是view下面的播放器要能继续播放,而且能看到画面。
      

  2.   

    我把view的背景设成#00000000了,但是还是背景全黑,把下面播放界面完全遮住了,还有什么好点的办法啊,或者是把控制界面用其他实现而不用覆盖一层view,前提是鼠标移动一下或者是点击一下他就出来,我是给电视上做的播放器,可以用鼠标键盘操作的。
      

  3.   

    我知道有两种方法解决。一是用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>