如何保证linearlayout_Android怎么让LinearLayout的两个按钮之间存在一些间隔

展开全部

可以按照以下代码进行尝试:

xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:orientation="vertical"

android:padding="10dp"

>

android:id="@+id/btnAction1"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:background="@drawable/cool_button"

android:text = "HiText1"

/>

android:id="@+id/btnAction2"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:background="@drawable/cool_button"

android:text="HiText2"

android:layout_below="@id/btnAction1"

/>

扩展资料

若设置一个控件32313133353236313431303231363533e58685e5aeb931333431363561为android:graviity="center|top" 那么这个控件中的子控件位于该控件的中心位置靠上的部位。

若设置一个控件为android:layout_gravity="center|top" 那么这个控件位于他父控件的中心位置靠近上的部位,是对这个控件本身位置的操作。

android:layout_marginBottom:离某元素底边缘的距离

android:layout_marginLeft:离某元素左边缘的距离

android:layout_marginRight:离某元素右边缘的距离

android:layout_marginTop:离某元素上边缘的距离

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值