[英]Android fragment z-index overlay
我有兩個片段,一個片段要放在另一個片段的上方,它占據了整個屏幕。 我怎樣才能做到這一點?
碼:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:opencv="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_relativelayout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<fragment
android:id="@+id/MainCameraFragment"
android:name="com.james.skullyhud.main_camera.MainCameraFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</fragment>
<fragment
android:id="@+id/map"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
class="com.google.android.gms.maps.MapFragment" >
</fragment>
</RelativeLayout>
干杯
<RelativeLayout
android:id="@+id/main_relativelayout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="@+id/map"
class="com.google.android.gms.maps.MapFragment"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true">
</fragment>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="@+id/MainCameraFragment"
android:name="com.james.skullyhud.main_camera.MainCameraFragment"
android:layout_width="match_parent"
android:layout_height="match_parent">
</fragment>
</RelativeLayout>
</RelativeLayout>
這對我有幫助:
YourFragment.getView().bringToFront();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.