Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to group ui elements ios

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

like image 406
thommie Avatar asked Jun 27 '12 15:06

thommie


3 Answers

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

like image 188
Bruno Koga Avatar answered Oct 16 '22 09:10

Bruno Koga


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

like image 26
logancautrell Avatar answered Oct 16 '22 08:10

logancautrell


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

like image 2
thommie Avatar answered Oct 16 '22 08:10

thommie