RelativeLayout 布局

本文介绍了一个使用Android的RelativeLayout实现的腾讯QQ登录界面布局案例。该界面包括了多个TextView、EditText和Button组件,并通过XML定义了各组件的位置及样式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ddf4e9"
    tools:context="com.example.administrator.jreduch01.RelativeActivity">
  <TextView
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
       android:text="腾讯QQ"
      android:textSize="40sp"
      android:gravity="center"
      android:background="#efeeee"
      android:id="@+id/tv1"/>
    <TextView
        android:layout_width="match_parent"
        android:layout_height="10dp"
        android:background="#d6d3d3"
        android:id="@+id/tv2"
        android:layout_below="@id/tv1"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/tv3"
            android:layout_marginTop="40dp"
            android:text="QQ登录"
            android:textSize="30sp"
            android:drawableLeft="@mipmap/ic_launcher"
            android:layout_below="@id/tv2"/>
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="亿万用户已经登录使用"
            android:layout_marginTop="80dp"
            android:layout_marginLeft="60dp"
            android:id="@+id/tv4"
            android:layout_below="@id/tv2"
            android:layout_toRightOf="@id/tv3"


            />


    <EditText
        android:layout_width="350dp"
        android:layout_height="50dp"
        android:hint="QQ账号/邮箱/手机号"
        android:background="#ffffff"
        android:textColor="#f0f1f0"
        android:textSize="30sp"
        android:layout_marginTop="20dp"
       android:layout_marginLeft="20dp"
        android:id="@+id/et1"
        android:layout_below="@id/tv3"/>
    <EditText
        android:layout_width="350dp"
        android:layout_height="50dp"
        android:hint="QQ密码"
        android:layout_marginTop="10dp"
        android:layout_marginLeft="20dp"
        android:background="#ffffff"
        android:textColor="#f0f1f0"
        android:textSize="30sp"
        android:id="@+id/et2"

        android:layout_below="@id/et1"/>

    <Button
        android:layout_width="300dp"
        android:layout_height="50dp"
        android:text="登录"
        android:id="@+id/button"
        android:textColor="#f7f9f8"
        android:background="@drawable/login_bg"
        android:textSize="30sp"
        android:layout_marginTop="40dp"
        android:layout_centerHorizontal="true"
        android:layout_below="@id/et2"

       />
</RelativeLayout>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值