Are there any standard way to implement the “blue badge” in iPhone?

后端 未结 5 1273
故里飘歌
故里飘歌 2020-12-22 20:39

A lot of iPhone apps use a blue badge to indicate the number of items in the subviews, such as the Mail client:

iPhoto http://img.skitch.com/20081103-tjr9yupbhgr3sqf

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-22 21:05

    I think a better way to implement something very close to the UITabBarItem badge is to use the UIImage stretchableImageWithLeftCapWidth:topCapHeight: method where both end caps could be a fancier image and the middle will be strech automatically (using the 1px wide image) to fit the NSString size that would be overlaid on top.

    Still need to get the proper images but that could be easily pulled from a screenshot or constructed from PS.

提交回复
热议问题