欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

android的编辑框(EditText)的实际案例代码分享

程序员文章站 2022-04-01 19:40:00
运行效果图在xml下添加代码

运行效果图

android的编辑框(EditText)的实际案例代码分享

在xml下添加代码

<?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="#EAEAEA"
    android:paddingBottom="16dp"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:paddingTop="16dp"
    tools:context=".MainActivity">
    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:lines="6"
        android:hint="说点什么吧..."
        android:background="#FFFFFF"
        android:padding="5dp"
        android:gravity="top"
        android:layout_marginBottom="10dp"
        android:inputType="textMultiLine"
        />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="添加照片"
        android:gravity="center_vertical"
        android:background="#FFFFFF"
        android:padding="8dp"
        android:drawablePadding="8dp"
         />

</LinearLayout>

android的编辑框(EditText)的实际案例代码分享

本文地址:https://blog.csdn.net/qq_44716544/article/details/107895385

相关标签: android EditText