Android 创建类似 iphone 的渐变
我需要在我的 Android 应用程序中创建类似黑色 iphone 的渐变。请查看下图中顶部的黑色渐变。怎么做呢?谢谢
I need to create black iphone like gradient in my android application. Please view black gradient at the top in the image below. How to do it? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我知道这是一个老问题,但我一直在努力为想要在 Android 上复制 iPad 应用程序的客户获得同样的效果,这就是我想出的:
I know this is an old question, but I was messing around to get this same effect for a customer who wants a copy of his iPad app on Android, this is what I came up with:
也许是这样的?
Something like this, perhaps?
我发布了一篇关于 iPhone 和 Android 的博客:
http://www.dibbus.com/ 2011/06/android-gradient-toolbar/
您可以找到一些渐变示例以及使用 xml 和/或 9-pacth 图像的可能性。
I've posted a blog about an Iphone look an Android:
http://www.dibbus.com/2011/06/android-gradient-toolbar/
You can find some examples of gradients and what is possible using xml and/or 9-pacth images.
您可以在 XML 中创建渐变。
此示例是圆形渐变,但通过更改类型参数,您可以创建其他渐变。
将此代码包含在可绘制文件夹中的 xml 文件中,您可以在设置背景时引用该文件。 IE。 android:background="你的可绘制文件"
You can create gradients in XML
This example is a round gradient but by changing type param you can create others.
Include this code in a xml file in your drawable folder and you can refer to that file when you set a background. ie. android:background="your drawable file"