I am looking for simple way how to create a button (or other subclass of UIView
) that is not drawn in all its frame but only within specified inner (inset) rectangle. The inner (inset) rectangle will have rounded corners of some custom radius. Picture below demonstrates it:
To summarise:
- control will respond to touch events within all its frame (the outer rectangle)
- content, background, etc. of the control will only by drawn in the inner (inset) rectangle
- size of inner rectangle and its corner radius must be customisable
Subclassing is an option but it there is simpler solution I will go with that.