我想创建一个将在两个布局之间叠加的按钮。
我正在使用线性布局并为其添加适当的权重。
附上屏幕截图以供参考。
这是我的 XML
标签.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:weightSum="100" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="30"
android:background="@color/greyColor"
android:gravity="center" >
<ImageView
android:id="@+id/ximgvwCamera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/camera_big" />
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="70"
android:background="@android:color/white" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@android:color/white"
android:gravity="center_horizontal"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="5dp"
android:padding="5dp"
android:text="@string/strQ1"
android:textAppearance="@android:style/TextAppearance.Medium"
android:textColor="@android:color/darker_gray" />
</LinearLayout>
</ScrollView>
请帮助我。
提前致谢!
试试这个它会工作...
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="150dp" >
<ImageView
android:id="@+id/imageCover"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/image_top" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:background="@drawable/image_bottom"
android:layout_height="match_parent" >
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/imageProfile"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="end"
android:layout_marginTop="100dp"
android:src="@drawable/ic_launcher" />
</FrameLayout>
像这样查看
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)