I'm looking for a way to group some ui elements together just like the twitter app does but I can't find anything which suits my needs.
equivalent to jpanel in java or groupbox in .net
this is what I'm talking about: http://i46.tinypic.com/169etxi.jpg
On interface builder, you can embed ui elements in a view or scrollview. Just select all the elements you want to group and then click Editor -> Embed In -> View/Scrollview
Grouping UI elements in UIKit is as simple as putting child views into a parent UIView
. Just use the addSubview:
method.
From the docs:
Views can embed other views and create sophisticated visual hierarchies. This creates a parent-child relationship between the view being embedded (known as the subview) and the parent view doing the embedding (known as the superview).
Here are the docs:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIView_Class/UIView/UIView.html
One, not so neat, solution is to create an image and use it as the background and put the ui elements on top of it. Here is the image I used(retina). http://tinypic.com/r/6i9m3b/6
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With