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>

  • 相关阅读:
    与众不同 windows phone (12) Background Task(后台任务)之 PeriodicTask(周期任务)和 ResourceIntensiveTask(资源密集型任务)
    直观理解图像的傅里叶变换
    简明Python3教程 13.面向对象编程
    简明Python3教程 4.安装
    简明Python3教程 8.控制流
    简明Python3教程 11.数据结构
    简明Python3教程 16.标准库
    简明Python3教程 12.问题解决
    简明Python3教程 9.函数
    简明Python3教程 2.序言
  • 原文地址:https://www.cnblogs.com/my-love-is-python/p/14515341.html
Copyright © 2011-2022 走看看