每日总结2023/2/22

今天学习了Android Studio中页面布局,控件按钮等

学习了背景的应用、背景的设置,hind提示的使用,输入框的方式,文字居中,左侧距离,右侧距离

成果:

 

复制代码
<?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:background="@mipmap/se"
    android:orientation="vertical"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/tv_1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ellipsize="end"
        android:maxEms="10"
        android:paddingTop="10dp"
        android:text="The first text!"
        android:textColor="#F8F3F3"
        android:textSize="20dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.393" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="200dp"
        android:ellipsize="end"
        android:gravity="center"
        android:text="欢迎登录!"
        android:textColor="@color/white"
        android:textSize="25dp" />

    <EditText
        android:id="@+id/et_1"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_marginTop="20dp"
        android:background="@drawable/bg_usersname"
        android:hint="用户名:"
        android:maxEms="6"
        android:maxLines="1"
        android:padding="5dp"
        android:textSize="20dp" />

    <EditText
        android:id="@+id/et_2"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_marginTop="20dp"
        android:background="@drawable/bg_usersname"
        android:hint="密码:"
        android:inputType="textPassword"
        android:maxEms="10"
        android:maxLines="1"
        android:padding="5dp"
        android:textColor="#D82020"
        android:textSize="20dp" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:orientation="horizontal"
        >
        <Button
            android:id="@+id/btn_login_1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="登录"
            android:layout_marginLeft="10dp"/>

        <Button
            android:id="@+id/btn_login_2"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="10dp"
            android:text="注册" />


    </LinearLayout>
</LinearLayout>
复制代码

 

对于跳转的应用还未学习。今天的学习到此为止。

由于明天篮球考试,晚上去篮球场练习,未曾学习。

 

posted @   花伤错零  阅读(14)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)

阅读目录(Content)

此页目录为空

点击右上角即可分享
微信分享提示