如何增加的LinearLayout android系统中的元素之间的空间? [英] how to increase the space between the elements in linearlayout in android?

查看:143
本文介绍了如何增加的LinearLayout android系统中的元素之间的空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序,我已经使用的LinearLayout,里面,我有3的EditText元素。现在,我想增加EDITTEXT元素之间的空间(填充)。这可能吗?

In my application, I had Used linearlayout, inside that I am having 3 EditText elements. Now I want to increase the space(padding) between the Edittext element. Is it possible?

推荐答案

您应该设置布局保证金像下面,在.xml文件您的EditText

You should set layout margin like below, in your edittext in .xml file

 android:layout_marginLeft="5dp"

你能做到这一点的marginTop下,左,右,取决于你的需求。您必须在布局元素指定此,而不是在布局本身。

you can do that for marginTop Bottom, Right and left , depends on your requirement. You must specify this on the layout elements, not on the layout itself.

填充和保证金之间的区别: - 填充相关的内部空间来看,和保证金是两种观点,

difference between padding and Margin:- Padding related to space inside view, and Margin is the space outside view or space between two views,

如果在任何一个方向上所需的外视图的空间,可以如上面给出实现。如果在下面的标签查看周围所有侧所需的空间可能非常有用

if space required outside view in any one direction, can be achieved as given above. and if space required on all side of view surroundings below tag can be useful

安卓layout_margin =5DP

这篇关于如何增加的LinearLayout android系统中的元素之间的空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆