![](/img/trans.png)
[英]TableLayout: Buttons have to stick together without leaving any space
[英]stick LinearLayour ( horizontal ) to the buttom without any space
對不起,我已經非常完成了我的問題,所以我重申了這一點並刪除了上一篇文章...
我在我的項目中的RelativeLayout中使用了LinearLayout(在原始中有4個ImageButtons)並且我使用了android:layout_alignParentBottom =“true”它(線性)堅持RelativeLayout的buttom,但我的問題是它之間的空間LinearLayout的ImageButtons和屏幕的角落。 我想刪除它們,使我的ImageButtons像屏幕底部的菜單欄。 有人可以幫我嗎? 謝謝 ! :)
<?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>
刪除RelativeLAyout上的填充
從:
<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">
至:
<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.