Android Studio

发布于:2025-08-19 ⋅ 阅读:(17) ⋅ 点赞:(0)

下载:
https://developer.android.google.cn/studio?hl=zh-cn

配置:

https://mirrors.huaweicloud.com/gradle/gradle-8.13-bin.zip




登录页面:
 

<LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <!-- 标题区域 -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="200dp"
            android:layout_marginTop="50dp"
        android:background="#dddddd"
        android:gravity="center"
        android:orientation="vertical">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="用户登录"
            android:textAlignment="center"
            android:textSize="20sp" />
    </LinearLayout>

    <!-- 用户名输入行 -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:paddingHorizontal="50dp"
    android:orientation="horizontal">

    <TextView
        android:layout_width="60dp"
        android:layout_height="match_parent"
        android:gravity="center"
        android:text="用户名" />

    <EditText
        android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_weight="1"
    android:inputType="text"
    android:textSize="16sp" />
</LinearLayout>

    <!-- 密码输入行 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:paddingHorizontal="50dp"
android:orientation="horizontal">

<TextView
    android:layout_width="60dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="密码" />

<EditText
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_weight="1"
    android:inputType="textPassword"
    android:textSize="16sp" />
</LinearLayout>

    <!-- 按钮区域 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:paddingTop="20dp">

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="登录"
    android:layout_marginHorizontal="10dp"/>

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="重置"/>
        </LinearLayout>
    </LinearLayout>
implementation "com.squareup.okhttp3:okhttp:4.9.1"






网站公告

今日签到

点亮在社区的每一天
去签到