【发布时间】:2012-10-01 08:26:07
【问题描述】:
您好,我想知道如何将框对齐到 android 屏幕的底部?我已经把盒子做成了一个 9patch png 图像,但实际图像和边框之间仍然存在一些差距。谁能帮帮我吗?我的意思是,控制图像大小的图形布局屏幕上的蓝色边框与实际图像之间存在实际间隙。请原谅我的英语。
这是蓝色框的xml代码
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@drawable/background" />
<ImageView
android:id="@+id/topbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:src="@drawable/top_bar" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/topbar"
android:layout_centerHorizontal="true"
android:layout_marginTop="95dp"
android:src="@drawable/icon_green" />
<ImageView
android:id="@+id/box"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="23dp"
android:src="@drawable/box" />
</RelativeLayout>
【问题讨论】:
-
这里是完整的 xml。希望你能帮忙:)
-
你能添加你当前布局的图片链接吗?您在上一个
ImageView中有android:layout_marginBottom="23dp"。 -
Yul 我还不能添加图片,因为我有足够的声誉,但我会检查边缘部分
-
所以你可以添加一个自我回答并检查它。
标签: android xml image xml-drawable