zoukankan      html  css  js  c++  java
  • Android开发UI布局之QQ登陆界面练习

    一、样图

    二、源程序代码

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical" android:layout_width="match_parent"
        android:layout_height="match_parent">
        <!--QQ登陆UI布局练习-->
    
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_marginTop="80dp"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="30dp">
            <TextView
                android:layout_width="wrap_content"
                android:drawableLeft="@mipmap/ic_launcher"
                android:text="QQ"
                android:textSize="40sp"
                android:layout_height="wrap_content"/>
    
            <EditText
                android:layout_marginTop="30dp"
                android:layout_width="match_parent"
                android:textSize="30sp"
                android:hint="QQ号码/手机号/邮箱"
                android:layout_height="wrap_content"/>
    
            <EditText
                android:layout_width="match_parent"
                android:textSize="30sp"
                android:hint="登陆密码"
                android:layout_height="wrap_content"/>
    
            <Button
                android:layout_width="match_parent"
                android:textSize="20dp"
                android:text="登陆"
                android:layout_height="wrap_content"/>
    
    
            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
    
                <TextView
                    android:layout_marginTop="10dp"
                    android:layout_width="wrap_content"
                    android:textSize="20dp"
                    android:text="忘记密码?"
                    android:layout_height="wrap_content"/>
                <TextView
                    android:layout_marginTop="10dp"
                    android:layout_width="wrap_content"
                    android:textSize="20dp"
                    android:layout_alignParentRight="true"
                    android:text="新用户注册"
                    android:layout_height="wrap_content"/>
            </RelativeLayout>
    
        </LinearLayout>
            <TextView
                android:layout_centerHorizontal="true"
                android:layout_width="wrap_content"
                android:layout_marginBottom="40dp"
                android:layout_alignParentBottom="true"
                android:text="登录即代表阅读并同意阅读条款"
                android:layout_height="wrap_content"/>
    
    </RelativeLayout>

    三、效果图

     四、总结心得

      总体是一个相对布局,其中嵌套这部分的线性布局,其中“忘记密码”和“新用户注册”是通过相对布局来放置的。其中输入的地方用的是edittext。另外还有需要注意的是图片导入的时候图片的存储形式需要和所用设备的型号所匹配,具体的信息可以在一篇文章中借鉴(转载)https://www.sunofbeach.net/a/1167623719519117312

  • 相关阅读:
    F#周报2019年第33期
    The .NET World——gPRC概览
    编程杂谈——Non-breaking space
    F#周报2019年第32期
    F#周报2019年第31期
    F#周报2019年第30期
    pat 乙级 1015. 德才论 (25) c++
    pat 乙级 1008. 数组元素循环右移问题 (20)
    PAT 乙级 1007. 素数对猜想 (20) c++ 筛选法求素数
    PAT-B 1005. 继续(3n+1)猜想 (25) c++
  • 原文地址:https://www.cnblogs.com/suanai/p/12245767.html
Copyright © 2011-2022 走看看