I've added some buttons to an UIView (via addSubview) programmatically. However, they appear as overlays (so that I always see the last button only). How do I add new buttons below existing buttons?
Regards
I've added some buttons to an UIView (via addSubview) programmatically. However, they appear as overlays (so that I always see the last button only). How do I add new buttons below existing buttons?
Regards
you can offset the button like this
and either set the frame for new button when you create it:
or set the frame later
Set the UIView's frame origin to layout the UIButtons in the locations you wish:
Thanks for your answers guys.
I did the (horizontal) align with this code:
It works technically, but still overlays the buttons. I have to find a way, how to not overlay them...
You can either use the insertSubview:atIndex method or insertSubview:belowSubview of your view.
OR