Android 2.2。这完全是奇怪的:)
我的活动A有ImageButton
。单击此按钮时,活动B将启动。 B是摄像机捕获活动,其中SurfaceView
保存图像。它有效,我可以看到我的相机看到了什么。
现在,只要我在活动A中设置ImageButton
的背景,活动B的SurfaceView
就会变成蓝色(我的形状颜色),我无法看到相机看到的内容,明显。
这有效(main_layout.xml):
<ImageButton android:layout_width="100dip" android:layout_height="100dip" />
后续活动获得蓝色表面:
<ImageButton android:background="@drawable/myshape" android:layout_width="100dip" android:layout_height="100dip" />
这是我的形状。 如果我删除solid
块,问题就会消失。什么......?!请告诉我它有什么问题!
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ff0000ff"/>
<stroke android:width="1dp" android:color="#ffffffff" />
<padding android:left="1dp" android:top="1dp" android:right="1dp"
android:bottom="1dp" />
</shape>