• EditText的圆角与边框


    先看一下效果图:

    先创建一个xml文件edittext_shape.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle" >
    
        <solid
            android:color="#FFFFFF" >
        </solid>
        <!-- 设置圆角 -->
        <corners
            android:radius="1dp"
            android:bottomLeftRadius="15dp"
            android:bottomRightRadius="15dp"
            android:topLeftRadius="15dp"
            android:topRightRadius="15dp" >
        </corners>
        <!-- 设置边框 -->
          <stroke android:width="1dip" android:color="#ff000000" />
    
    </shape>

    接着在需要设置圆角样式的edittext中设置background属性:

    <EditText 
                  android:id="@+id/et_empid"
                  android:layout_width="match_parent"
                  android:layout_height="50dp"
                  android:text=""
                  android:textSize="25sp"
                  android:background="@drawable/edittext_shape"
                  android:layout_toRightOf="@id/tv_empid"
                  android:paddingLeft="10dp"
                  android:textColor="#3b3c3c"
                  android:hint="请输入员工编号"
                  />

    最后运行项目,就出现了上面的效果图。

  • 相关阅读:
    mvc:三
    mvc:二
    Linq分组,linq方法分组
    Linq 中按照多个值进行分组(GroupBy)
    Photoshop 字体
    报表Reporting S而vice是 错误的解决
    1*书籍装帧
    photoshop 魔术橡皮擦
    Photoshop 钢笔 双窗口显示
    数字格式化
  • 原文地址:https://www.cnblogs.com/yby-blogs/p/4257103.html
Copyright © 2020-2023  润新知