简体   繁体   English

将LinearLayour(水平)粘贴到按钮上,没有任何空间

[英]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.

相关问题 TableLayout:按钮必须粘在一起而没有任何空间 - TableLayout: Buttons have to stick together without leaving any space 动态向选项卡添加多个水平linearlayour - Dynamically add multiple horizontal linearlayour to tab "项目之间的水平线性布局空间,没有左右填充" - Horizontal LinearLayout space between items without padding left and right ListView下方的LinearLayour不可见 - LinearLayour below ListView is not visible Android:将自己的视图添加到LinearLayour - Android: Add own View to LinearLayour 在同一行中显示四个按钮,它们之间没有空格? - Show four button in same line without any space between them? 如何使按钮底部对齐,按钮下方没有任何空间 - How to make the buttons align bottom without any space below the buttons 如何按比例缩放活动以完全适应没有图像的图像 - How to scale activity to fit the no of images exactly without any space 尝试为LinearLayout中的任何屏幕均匀地间隔按钮,而不拉伸图像 - Trying to space buttons evenly for any screen in a LinearLayout, without stretching the images Android:Intellij Buttom 导航模板创建未使用的空间,隐藏其下的节点 - Android: Intellij Buttom nav template creates unused space, hides nodes under it
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM