【问题标题】:Blur shadow around edittext with rounded corners用圆角模糊编辑文本周围的阴影
【发布时间】:2020-09-30 07:33:26
【问题描述】:

谁能解释一下并举个例子-如何在带有圆角的edittext周围添加模糊阴影
喜欢图片

【问题讨论】:

  • 这不是EditText 内的CardView 吗?

标签: android gradient shadow blur


【解决方案1】:

我认为这是一个高度。您需要做的是您需要为 EditText 添加带圆角的背景,并为 EditText 设置边距,因为没有边距,您的阴影将被切断。

edittext_background.xml

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@color/white"/>

    <corners android:bottomRightRadius="8dp" android:bottomLeftRadius="8dp"
        android:topLeftRadius="8dp" android:topRightRadius="8dp"/>
</shape>

编辑文本:

<EditText
                android:layout_width="match_parent"
                android:layout_height="40dp"
                android:elevation="8dp"
                android:background="@drawable/edittext_background"
                android:layout_margin="16dp" />

【讨论】:

  • 是的。你说的对。太容易了)))我寻找模糊阴影......
猜你喜欢
  • 2012-12-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-07-16
  • 2013-12-16
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多