zoukankan      html  css  js  c++  java
  • 2021.2.17 LinearLayout

    一、今日学习内容

      

    LinearLayout:线性布局管理器

    1、特点:将放入其中的组件按照垂直或水平的方向进行排列


    2、垂直线性布局管理器:

    android:orientation="vertival"

    每一行只能放置一个组件


    3、水平线性布局管理器:

    android:orientation="horizontal"

    每一列只能放置一个组件


    4、<LinearLayout>标记常用属性:

    android:orientation:设置排列方式

    android:gravity:设置显示位置


    5、子组件属性

    android:layout_weight属性:设置组件占父容器空间的比例,默认值为0.分配的是屏幕剩余空间

    复制代码
     1 <?xml version="1.0" encoding="utf-8"?>
     2 <LinearLayout
     3     xmlns:android="http://schemas.android.com/apk/res/android"
     4     xmlns:tools="http://schemas.android.com/tools"
     5     android:id="@+id/activity_main"
     6     android:layout_width="match_parent"
     7     android:layout_height="match_parent"
     8     android:paddingLeft="@dimen/activity_horizontal_margin"
     9     android:paddingRight="@dimen/activity_horizontal_margin"
    10     android:paddingTop="@dimen/activity_vertical_margin"
    11     android:paddingBottom="@dimen/activity_vertical_margin"
    12     android:orientation="vertical"
    13     tools:context="com.example.example.MainActivity">
    14 
    15     <EditText
    16         android:layout_width="match_parent"
    17         android:layout_height="wrap_content"
    18         android:paddingBottom="20dp"
    19         android:hint="QQ号/微信号/Email"
    20         android:drawableLeft="@mipmap/zhanghao"
    21         />
    22 
    23     <EditText
    24         android:layout_width="match_parent"
    25         android:layout_height="wrap_content"
    26         android:paddingBottom="20dp"
    27         android:hint="密码"
    28         android:drawableLeft="@mipmap/mima"
    29         />
    30     <Button
    31         android:layout_width="match_parent"
    32         android:layout_height="wrap_content"
    33         android:text="登录"
    34         android:textColor="#FFFFFF"
    35         android:background="#FF009688"/>
    36 
    37     <TextView
    38         android:layout_width="wrap_content"
    39         android:layout_height="wrap_content"
    40         android:text="登陆遇到问题?"
    41         android:layout_gravity="center_horizontal"
    42         android:paddingTop="20dp"/>
    43 
    44 </LinearLayout>
    复制代码

    二、遇到的问题

       没有遇到什么问题

    三、明日计划

        明天学习关于帧布局管理器的内容

  • 相关阅读:
    鸡兔同笼问题多解
    JavaSE复习日记 : 循环语句(for/while/do while)
    JavaSE复习日记 : 八种基本数据类型
    递归函数
    JavaSE复习日记 : 条件判断语句
    访问权限系列一(public/private/protected/default):成员变量
    JavaSE复习日记 : 算是个小前言吧
    转:SQL Server 索引和视图
    转:SQL Server 数据库基础编程
    转:在网页html/aspx中增加一段播放器代码
  • 原文地址:https://www.cnblogs.com/wmdww/p/14864721.html
Copyright © 2011-2022 走看看