简体   繁体   English

如何在 Android 上获得卷曲或波浪形边框?

[英]How can I achieve curly or wavy borders for a view on Android?

There is the concept of rounded corners for views and drawables in Android, however, am working on an interface for a kids robot, and someone asked for curly borders - sort of like wavy (sine wave kind of thing). Android 中有用于视图和可绘制对象的圆角的概念,但是,我正在为儿童机器人开发一个界面,有人要求使用卷曲边框 - 有点像波浪形(正弦波之类的东西)。 Now, how the heck can one achieve such a thing in either XML or Java - especially, without resorting to use of image overlays or backgrounds?现在,到底是如何在 XML 或 Java 中实现这样的事情的——尤其是在不使用图像覆盖或背景的情况下?

rounded corners aren't in fact rounded View s, its just a bit of transparency in corners.圆角实际上并不是圆角View ,它只是角落的一点透明度。 you can create some custom drawable s/ Bitmap s and set for your View s (as a background or use ImageView ) or you can use custom programmatic drawing like HERE您可以创建一些自定义drawable s/ Bitmap并为您的View设置(作为背景或使用ImageView ),或者您可以使用自定义编程绘图,如HERE

Have tried to use images of that form and use them as background in a transparent container?是否尝试使用该形式的图像并将它们用作透明容器中的背景?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM