【发布时间】:2013-05-18 09:45:48
【问题描述】:
我有两个片段,一个我想要在另一个之上,占据整个屏幕。我该怎么做?
代码:
<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>
干杯
【问题讨论】:
-
bringChildToFront是您可能需要的。看看http://developer.android.com/reference/android/view/ViewGroup.html#bringChildToFront(android.view.View)。如果有帮助,请告诉我,届时我将作为答案。