在Android中的编辑文本边框中添加渐变 [英] Add gradient in edit text border in android

查看:85
本文介绍了在Android中的编辑文本边框中添加渐变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想在我的editText的边界上添加渐变,我可以添加渐变,但是它需要整个背景.如何仅将渐变应用到边框,其余的应该是透明的?

I want to add gradient only to the border of my editText , I can add gradient but it takes the entire background . How can I apply gradient only to the border , and the rest should be transparent?

推荐答案

  • 在布局中添加 edittext
  • 为该布局设置渐变背景颜色
  • edittext 设置边距1dp.
  • edittext
  • 设置白色背景

    • Add the edittext in a layout
    • Set gradient background color for that layout
    • Set margin 1dp for edittext.
    • Set white background for edittext
    • 我认为现在显示的内容与您的期望一样,谢谢

      i think now it's displays like your expectation, thank you

      这篇关于在Android中的编辑文本边框中添加渐变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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