• Android基础-EditText(整体布局的输入框修正)


    EditText主要用于输入框

    属性

       1.android:inputType 输入类型(textPassword:密码, number:正整数 numberSigned 输入整数 numberDecimal小数)

      2.android:hint="password"输入提示语 

      3.android:maxLength="12" 表示输入字符串的长度

    对整体的布局中的EditText做简要的修正

    <?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"
        android:background="@mipmap/bg"
        tools:context=".MainActivity"
        android:gravity="center_horizontal">
    
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Sign up"
            android:layout_marginTop="70dp"
            android:visibility="invisible"/>
    
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Imooc Imooc Imooc Imooc
     Imooc Imooc"
            android:layout_margin="20dp"
            android:gravity="center_horizontal"/>
    
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@mipmap/add_photo"
            android:layout_margin="10dp"/>
    
        <!--
        android:inputType 输入类型
            textPassowrd 密码
            number 只能有正整数
            numberSigned 只能输入整数
            numberDecimal 小数
        -->
    
        <EditText
            android:layout_width="match_parent"
            android:layout_height="68dp"
            android:layout_marginLeft="30dp"
            android:layout_marginRight="30dp"
            android:layout_marginTop="25dp"
            android:hint="Name and Surname"
            android:gravity="center"
            android:textColorHint="#cccccc"
            android:background="@mipmap/border"/>
    
        <EditText
            android:layout_width="match_parent"
            android:layout_height="68dp"
            android:layout_marginLeft="30dp"
            android:layout_marginRight="30dp"
            android:layout_marginTop="25dp"
            android:hint="Emial Address"
            android:gravity="center"
            android:textColorHint="#cccccc"
            android:background="@mipmap/border"/>
    
        <EditText
            android:layout_width="match_parent"
            android:layout_height="68dp"
            android:layout_marginLeft="30dp"
            android:layout_marginRight="30dp"
            android:layout_marginTop="25dp"
            android:hint="Phone"
            android:gravity="center"
            android:textColorHint="#cccccc"
            android:inputType="phone"
            android:background="@mipmap/border"/>
    
        <EditText
            android:layout_width="match_parent"
            android:layout_height="68dp"
            android:layout_marginLeft="30dp"
            android:layout_marginRight="30dp"
            android:layout_marginTop="25dp"
            android:hint="Password"
            android:gravity="center"
            android:textColorHint="#cccccc"
            android:inputType="textPassword"
            android:maxLength="12"
            android:background="@mipmap/border"/>
    
        <Button
            android:layout_width="match_parent"
            android:layout_height="68dp"
            android:layout_marginLeft="30dp"
            android:layout_marginTop="20dp"
            android:layout_marginRight="30dp"
            android:background="@mipmap/btn"
            android:text="Register"
            app:backgroundTint="@color/teal_700" />
    
    
    
    </LinearLayout>

  • 相关阅读:
    ios开源项目2
    Cocoa 框架 For iOS(一) 框架的介绍
    iPhone开源项目大全
    8款iOS的日历开源代码
    二维码扫描工具和开发包 ZBar
    图文解释XCode常用快捷键的使用
    常用的iOS高效开源类库
    static_cast
    [转]SecureCRT rz 上传文件失败问题
    Linux中的EAGAIN含义
  • 原文地址:https://www.cnblogs.com/my-love-is-python/p/14515341.html
Copyright © 2020-2023  润新知