• 自定义 EditText 样式


    极力推荐文章:欢迎收藏
    Android 干货分享

    阅读五分钟,每日十点,和您一起终身学习,这里是程序员Android

    本篇文章主要介绍 Android 开发中的部分知识点,通过阅读本篇文章,您将收获以下内容:

    1.自定义EditText 圆角矩形背景
    2.自定义EditText 背景

    Android中自带的 EditText 样式比较丑,为了美化 EditText 可使用一下方法。
    实现效果如下:

    自定义EditText 背景

    1.自定义EditText 圆角矩形背景

    自定义圆角矩形 custom_edittext_background.xml

    
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            android:background="@drawable/custom_edittext_background"
            android:gravity="center"
            android:hint="自定义EditText"
            android:padding="8dp"
            android:textSize="16sp" />
    

    2.自定义EditText 背景

    <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
    
        <!-- 圆角-->
        <corners android:radius="5dp" />
        <!--描边-->
        <stroke
            android:width="1dp"
            android:color="@android:color/holo_blue_light" />
    
    </shape>
    

    至此,本篇已结束,如有不对的地方,欢迎您的建议与指正。同时期待您的关注,感谢您的阅读,谢谢!

    微信关注公众号:  程序员Android,领福利

  • 相关阅读:
    源码
    Leetcode 230. 二叉搜索树中第K小的元素 中序遍历
    Leetcode 160. 相交链表 哈希 链表
    Leetcode 142. 环形链表 II
    Leetcode 217. 存在重复元素 哈希 排序
    asp.mvc2.0资料
    关于CRM的介绍
    WPf控件模板缺省样式
    皮肤制作工具
    关于linq的用法
  • 原文地址:https://www.cnblogs.com/wangjie1990/p/11310740.html
Copyright © 2020-2023  润新知