【发布时间】:2011-06-21 13:06:29
【问题描述】:
我有两个视图占据整个屏幕,我想同时显示两个视图,一个在另一个之上。我的布局如下所示:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<org.example.myCustomView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
注意myCustomView使用onDraw(这个方法最后一个语句是invalidate())来绘制自定义图形。我遇到的问题是它只显示myCustomView,WebView 是隐藏的。我尝试将mycustomView 的背景颜色更改为透明,但这没有任何区别。
我还希望能够将myCustomView 叠加在WebView 上,反之亦然。
【问题讨论】:
标签: android android-layout android-webview