开发者

Custom UIView like iCal event "bubbles"

开发者 https://www.devze.com 2022-12-19 00:53 出处:网络
How would I go about creating a custom UIView that is like the event \"bubbles\" in iCal for iPhone?I would prefer to not use images, so that they could be in any color.

How would I go about creating a custom UIView that is like the event "bubbles" in iCal for iPhone? I would prefer to not use images, so that they could be in any color.

Thanks!

alt text http://img8.imageshack.us/img8/609/screenshot2开发者_运维知识库0100205at120.png


You can achieve many effects just playing with CALayer class. Matt Long had a nice blog post about how to use it to make nice UIButtons - may be you'll be able to apply this approach to your needs as well.


It's basically a rectangle with an arc at each corner. That gives you the shape. The highlight at the top to give it a shine can be done with a gradient drawn on top of the underlying layer. That should let you handle the color of the bubbles without resorting to images.

This SO question has some code to get you pointed in the right direction to draw rectangular shapes with arcs at the corner.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号