我已将ImageView
,SurfaceView
和控制元素覆盖为ImageView
的框架布局。因此,使用SurfaceView
播放MediaPlayer
媒体,然后使用ImageView
然后MediaPlayer
将媒体准备为静止图像。然后在准备ImageView
与静止图像setVisibility
- GONE
和我们播放视频。问题出在控制ImageViews
。因为他们一个PNG图像与透明图形,然后覆盖在透明区域上看起来不错,但MediaPlayer
播放视频,透明区域的图形看起来非常有色,我们禁用此控件...android:图像作为带有MediaPlayer的SurfaceView透明度的按钮
请帮我建议如何使控件看起来相同覆盖ImageView
和SurfaceView
。
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/FrameLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<SurfaceView
android:id="@+id/svMain"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<ImageView
android:id="@+id/ivMain"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="fitXY"
android:src="@drawable/still_image" />
<RelativeLayout
android:id="@+id/controls"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom" >
<ImageView
android:id="@+id/ibtnStart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:clickable="true"
android:onClick="ibtnClick"
android:src="@drawable/start_image" />
<ImageView
android:id="@+id/ibtnStop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:clickable="true"
android:onClick="ibtnClick"
android:src="@drawable/stop_image" />
</RelativeLayout>
</merge>
你有没有找到解决这个问题呢?我一直有相同的问题相当长一段时间没有解决... – 2013-01-18 20:44:18