安卓如何实现线性布局

 时间:2024-10-13 14:58:10

1、打开我们的编辑软件eclipse软件,如图所示;然后建立一个工程,至于怎么建工程,我相信小伙伴们应该知道怎么弄了;

安卓如何实现线性布局

3、在整个界面中输入一下代码:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal"> <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="寻迹" android:layout_weight="1" /> <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" 壁障" android:layout_weight="1" /> <Button android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" 追踪" android:layout_weight="1" /> <Button android:id="@+id/button4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" 学习" android:layout_weight="1" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hello_world" /></LinearLayout>接着保存;

安卓如何实现线性布局

5、如图所示,我们的执行结果如下;

安卓如何实现线性布局
  • 详解MongoDB如何更新文档 ( 增加和删除属性 )
  • 多可系统怎么找回管理员用户名和密码
  • 携程旅行在哪查看直播平台信息
  • 怎样打开win2016的注册表
  • javascript(js)中怎么获取下拉框option的值?
  • 热门搜索
    盐城旅游团 日本著名旅游景点 所罗门群岛旅游 桂林康辉旅游 广州旅游景点一日游 换房旅游 厦门旅游攻略住宿 清远旅游攻略 上海市旅游地图 伊斯坦布尔旅游