是否可以在SurfaceView
内显示PopoupWindow
?
使用此PopupWindow
的XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:padding="10dip"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#444444"
>
<SurfaceView
android:layout_width="100px"
android:layout_height="100px"
/>
</LinearLayout>
弹出窗口不起作用,并生成以下日志消息:
W/WindowManager( 60): Attempted to add window with token that is a sub-window: android.os.BinderProxy@4058e3c8. Aborting.
使用View
代替SurfaceView
可以正常使用。
修改 似乎使用平台2.3.3存在问题,但使用平台4.1都可以正常工作。我没有用其他平台版本测试它。