I have two views that take the whole screen and I want to display both views at the same time, one on top of the other. My layout looks like this:
<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>
Note that myCustomView
uses onDraw (this method last statement is invalidate()) to draw custom graphics. The problem I am getting is that it only displays myCustomView
, WebView
is hidden. I tried to change the background colour of mycustomView
to transparent but this makes no difference.
I would also like to have the ability to make myCustomView
as an overlay on WebView
or vice versa.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…