複数のレイアウトにまたがる「オーバーレイ」ビューを表示する方法を探しています(添付の画像に落書きされているように)。
私の調査によると、レイアウトは他のレイアウト内にしか存在できず、オーバーレイレイアウトのそのような概念はありません。それは可能ですか?助言がありますか?
どうもありがとう!ケイ。
複数のレイアウトにまたがる「オーバーレイ」ビューを表示する方法を探しています(添付の画像に落書きされているように)。
私の調査によると、レイアウトは他のレイアウト内にしか存在できず、オーバーレイレイアウトのそのような概念はありません。それは可能ですか?助言がありますか?
どうもありがとう!ケイ。
FrameLayoutは、重複するビューをkanがレンダリングする唯一のレイアウトです。
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Primary View Primary View Primary View Primary View" />
</LinearLayout>
<RelativeLayout
android:layout_width="100dp"
android:layout_height="match_parent"
android:background="#80FFFFFF" >
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="OverLap" />
</RelativeLayout>
</FrameLayout>
レイアウトの上にビューまたはレイアウト要素を表示する必要があると思います。このようなFrameLayoutを使用する必要がある場合
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
Your layout
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
Your view element to float or overlay
</LinearLayout>
</FrameLayout>