我一直在寻找答案,但提供的解决方案并没有解决我的问题。
我有一个显示一些视图(几个按钮和一个背景)的布局。为此,我添加了一个自定义控件,我已经扩展了线性布局。这个控件很好地显示在布局上方。我想要做的是添加一个额外的 ImageView,它比这个控件大,但它会在它的前面。
编辑:对不起,我希望这能解决问题。
我的活动有一个大布局(相对),我想在这个布局上堆叠两个额外的视图\布局,所以最终版本将是所附图片:
这是我的布局 - 它将图像视图堆叠在菜单栏上,而不是其他的。试图将 FrameLayout 放在其他地方仍然没有给我想要的结果。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background">
<RelativeLayout android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="450dip">
<com.myproject.controls.SearchControl
android:id="@+id/scSearch"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<ExpandableListView android:id="@+id/lstItems"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/scSearch"
android:layout_marginLeft="26dip"
/>
</RelativeLayout>
<FrameLayout android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.myproject.controls.MenubarMain
android:id="@+id/mbMenuBarMain"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
/>
<ImageView android:src="@drawable/myicon"
android:layout_width="200dip"
android:layout_height="200dip"
/>
</FrameLayout>
</LinearLayout>