安卓第四次课

.java文件 —— 工程位置
.xml布局文件文件 —— 工程位置

文本框(TextView)
宽度、高度(match_parent 、 wrap_content 、自己设置)

在这里插入图片描述

match_parent 和 wrap_content 的区别
match_parent :和父级容器相匹配
wrap_content :自适应大小

文字的大小(textSize),文字的样式(textStyle)

在这里插入图片描述
颜色(文字颜色 、背景颜色)
文字颜色 在这里插入图片描述
背景颜色 

位置关系(gravity和layout_gravity的区别)
gravity:文本位置
layout_gravity:布局相对于父级容器的位置

静态资源的引用(文本 ,颜色)

在这里插入图片描述
编辑框
Hint
Maxlines
按钮
Onclick:点击事件
控件与控件的位置关系
外边距,内边距
课堂写的代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".Login">

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="18dp"
    android:layout_gravity="left"
    android:background="@color/blue"
    android:gravity="center"
    android:text="@string/login_layout_name"
    android:textColor="@color/pink"
    android:textSize="36dp"
    android:textStyle="bold"></TextView>
<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="18dp"
    android:hint="@string/login_edittext"
    android:textColor="@color/blue"
    android:gravity="left"
    android:textSize="36dp"
    android:background="@color/yellow"
    android:maxLines="10"
    ></EditText>
<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="@string/login_password"
    android:textColor="@color/blue"
    android:gravity="left"
    android:textSize="36dp"
    android:background="@color/yellow"
    android:maxLines="10"
    ></EditText>
<Button
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:layout_marginTop="18dp"
    android:text="@string/login"
    android:background="@color/colorPrimary"></Button>
<Button
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:layout_marginTop="18dp"
    android:text="@string/register"
    android:background="@color/colorPrimary"></Button>
</LinearLayout>

在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值