I am looking for a way to add a padding property to a UIView. Ideally, I would like to avoid subclassing and put it in a category. Usage will be something like this:
myview.padding = UIEdgeInsetsMake(10, 10, 10, 10);
And perhaps it also has a paddingBox property that returns a CGRect describing the size and position of the internal padding field.
Now, how would I implement something similar in the category. At first I used bounds , but, unfortunately, the size of bounds is related to the size of the frame (always the same), only the coordinates can differ.
ios iphone cocoa-touch uikit uiview
Meda Feb 13 '13 at 15:21 2013-02-13 15:21
source share