Sovannarith
Sovannarith

Reputation: 616

How to draw item like this below in iOS?

My purpose is I want to draw an Item like below image :

enter image description here

But it is really difficult to draw an image like below that it has draw on another view. It's not an image, for example the value is "off" and this value depend on the value of string if we set long value it will expand.

enter image description here

Could you let me know the solution, how to solve it ?

Upvotes: 0

Views: 109

Answers (2)

Fr4ncis
Fr4ncis

Reputation: 1387

I think you want to put a badge on top of a view, right?

Check out http://www.cocoacontrols.com/platforms/ios/controls/jsbadgeview

Upvotes: 1

Kaan Dedeoglu
Kaan Dedeoglu

Reputation: 14841

welcome to Stackoverflow

The method you're looking for is the following:

- (UIImage *)resizableImageWithCapInsets:(UIEdgeInsets)capInsets (iOS5 or later)

for earlier iOS versions you have:

- (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight

Upvotes: 0

Related Questions