[英]stick LinearLayour ( horizontal ) to the buttom without any space
Sorry, i've completed my question very much, so I reasked that and deleted prev post... 对不起,我已经非常完成了我的问题,所以我重申了这一点并删除了上一篇文章...
I'm using LinearLayout ( with 4 ImageButtons in a raw ) in a RelativeLayout in my project and I have used android:layout_alignParentBottom="true" for it ( linear ) to stick to the buttom of RelativeLayout, but my problem is the space between LinearLayout's ImageButtons and the corners of the screen. 我在我的项目中的RelativeLayout中使用了LinearLayout(在原始中有4个ImageButtons)并且我使用了android:layout_alignParentBottom =“true”它(线性)坚持RelativeLayout的buttom,但我的问题是它之间的空间LinearLayout的ImageButtons和屏幕的角落。 I want to remove them to make my ImageButtons be like a menu bar on the bottom of the screen.
我想删除它们,使我的ImageButtons像屏幕底部的菜单栏。 Is it possible for anyone to help me please ?
有人可以帮我吗? THANK YOU !
谢谢 ! :)
:)
<?xml version="1.0" encoding="utf-8"?>
<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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".HomeActivity">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="TXT"
android:textAppearance="?android:attr/textAppearanceLarge" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:weightSum="4" >
<ImageButton
android:id="@+id/calibrate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/1" />
<ImageButton
android:id="@+id/chart"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/2" />
<ImageButton
android:id="@+id/guidance"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/3" />
<ImageButton
android:id="@+id/info"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable4" />
</LinearLayout>
</RelativeLayout>
and the result is something like this : Picture http://uploadtak.com/images/c6645_1311.png ! 结果是这样的: 图片http://uploadtak.com/images/c6645_1311.png ! 1
1
Remove the padding on your RelativeLAyout 删除RelativeLAyout上的填充
From: 从:
<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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".HomeActivity">
To: 至:
<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" >
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.