设计的EditText的圆角和放大器;内心的阴影 [英] Designing EditText with rounded corners & inner shadow

查看:122
本文介绍了设计的EditText的圆角和放大器;内心的阴影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个自定义的EditText同时具有圆角和内侧阴影。

I'm trying to create a custom EditText that has both rounded corners and an inner shadow.

我在创建内阴影图层列表,

I made a layer list that creates the inner shadow,

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <item >
        <shape android:shape="rectangle">
            <solid android:color="#6C6C6C" />           
        </shape>
    </item>

    <item>
        <shape android:shape="rectangle">
            <solid android:color="@color/ashes" />   
        </shape>
    </item>

    <!-- White Top color -->
    <item android:top="3px" android:left="3px">
        <shape android:shape="rectangle">
            <solid android:color="#FFFFFF" />           
        </shape>
    </item> 
</layer-list>

输出看起来是这样的,

The output looks like this,

如何还添加了圆润的造型?

How can I also add a rounded shape?

推荐答案

添加标记中的形状标签:

  <corners
      android:radius="5dp" />

这篇关于设计的EditText的圆角和放大器;内心的阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆