Reputation: 4084
I have a situation in which I need to have a button added to my view using Interface Builder, but the button shouldn't be seen, but if the user clicks the location of the button, the button can still call its method.
I've tried setting the opacity to zero, or changing the button to 'hidden', but both of these strategies result in a button that is completely invisible, but also useless, as it can't be pressed.
Does anyone have a solution for this?
Upvotes: 0
Views: 881
Reputation: 5226
You can try to custom type UIButton:
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
With empty title, empty background image.
Or set the type from the storyboard or Interface Builder:
Upvotes: 7