java 界面线性布局_怎么用java代码写一个线性布局;布局里面有两个按钮是水平的...

展开全部

android 使两个按钮水平排列的方法是使用lineLayout线性布局,如下e69da5e6ba9062616964757a686964616f31333337623433代码:<?xml  version="1.0" encoding="utf-8"?>

android:layout_width="fill_parent"

android:layout_height="match_parent"

android:background="@color/background"

android:orientation="vertical" >

android:layout_width="wrap_content"

android:layout_height="1.2px"

android:layout_marginBottom="7dp"

android:background="@color/white" />

android:layout_width="fill_parent"

android:layout_height="79dp"

android:layout_weight="2"

android:orientation="horizontal"

android:layout_margin="10dp" >

android:id="@+id/bt1"

android:layout_width="fill_parent"

android:layout_height="26dp"

android:background="@drawable/shape"

android:layout_weight="1"

android:text="确认对冲"

android:textColor="@color/white"

android:textSize="15dp" />

android:layout_width="fill_parent"

android:layout_height="26dp"

android:background="@drawable/shapeyuanjiao"

android:layout_weight="1"

android:text="取消"

android:textColor="@color/white"

android:textSize="15dp" />

运行结果如下:

3ae3ddf2d41265fb80e968049745cece.png

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值