LinearLayout布局

摘要:
˃布局文件˂?

LinearLayout布局第1张

布局代码

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <TextView
        android:text="第一行"
        android:gravity="center_vertical"
        android:textSize="15pt"
        android:background="#aa0000"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"/>
    
    <TextView
        android:text="第二行"
        android:textSize="15pt"
        android:gravity="center_vertical"
        android:background="#00aa00"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"/>
    
    <TextView
        android:text="第三行"
        android:textSize="15pt"
        android:gravity="center_vertical"
        android:background="#0000aa"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"/>
    <TextView
        android:text="第四行"
        android:textSize="15pt"
        android:gravity="center_vertical"
        android:background="#aaaa00"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"/>

</LinearLayout>

 LinearLayout布局第2张

布局文件

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <TextView
        android:text="第一列"
        android:gravity="center_horizontal"
        android:background="#aa0000"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_weight="1"/>
    
    <TextView
        android:text="第二列"
        android:gravity="center_horizontal"
        android:background="#00aa00"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_weight="1"/>
    
    <TextView
        android:text="第三列"
        android:gravity="center_horizontal"
        android:background="#0000aa"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_weight="1"/>
    
    <TextView
        android:text="第四列"
        android:gravity="center_horizontal"
        android:background="#aaaa00"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_weight="1"/>
</LinearLayout>

免责声明:文章转载自《LinearLayout布局》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇寒假作业总结一element-ui(vue)upload组件的http-request方法的使用下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

delphi 安卓配置教程

本教程以 delphi 10.2.2.2004 为例,演示 delphi 安卓配置步骤 1.打开 Android Tools 2. 选择合适的版本。比如:我的小米4 LTE 是 andorid 6.0 ,我就选 android 6.0 (API23) 和 23.0.1 ,其它可以一律不选。 明白了吧,更多详细步骤,请自动搜索 android 工具配置方法...

font-size:0; 消除空白间隙

使用font-size:0解决设置inline-block引起的空白间隙问题 一、空白间隙问题 在进行页面布局的时候为了页面代码所谓整洁刻度,往往会设置缩进或是换行,但是元素display为inline-block或是inline时,行内元素虽然没有设置  margin值,这些换行或是缩进。还是会出现空白间隙。 如下所示: HTML部分 <div i...

百度小程序开发实战--踩坑经历

文章列表rich-text的图片宽度问题效果如下后端返回的数据格式为string,小程序对次采用了rich-text来识别传入的htmlrich-text推荐使用node的数组模式,字符串模式会影响解析速度(因为最终还是会转换为数组类型),但是后端返回的为string格式,是由后台编辑器传入的。这就导致了无法操作css中 rich-text 里边的图片...

Android Studio安装及主题字体配置

   在2013 Google I/O 大会上,谷歌推出了自家全新的安卓软件集成开发工具 Android Studio,这是 Google 基于 IntelliJ IDEA 改动而来。        谷歌称 Android Studio 将会让开发人员更快、更具生产力,它全然免费,跨平台支持 Win/Mac/Linux,是替代 Eclipse 的最佳...

使用qt帮助 查看样式表stylesheet的帮助文档

QCreactor帮助文档中搜索的关键字 Qt Style Sheets Examples 有所有控件的样式例子 Qt Style Sheets Reference 控件的所有属性 The Style Sheet Syntax 使用setStyleSheet的语法 有所有控件的样式例子Style Sheet UsageCustomizing the For...

Android直播实现 Android端推流、播放

原文地址  :http://www.cnblogs.com/endv/p/7487685.html 最近想实现一个Android直播,但是对于这方面的资料都比较零碎,一开始是打算用ffmpeg来实现编码推流,在搜集资料期间,找到了几个强大的开源库,直接避免了jni的代码,集成后只用少量的java代码就可实现编码、推流和取流播放,整理了一下做了一个demo...