zoukankan      html  css  js  c++  java
  • 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>

  • 相关阅读:
    3.23.谷歌中国搜索关闭的日子
    在Fedora下成功将Vim打造成适用于C/C++的IDE
    有关内存DC和双缓冲位图的问题汇总
    [转]阶乘 n! 末尾 0 的个数
    [转]各种排序算法
    [转]使用CEGUI的Editbox进行中文输入
    [转]ASP.NET中文件上传下载方法集合
    背包问题的c++解法
    [转]经典C/C++算法
    [转]编写自己的MSN机器人
  • 原文地址:https://www.cnblogs.com/my-love-is-python/p/14515341.html
Copyright © 2011-2022 走看看