iPhone panel control - iphone

In my iPad application there are many buttons (around 50), and I want to make a group box which contain buttons arranged by category.
I am looking for something like a C# or .NET GroupBox/Panel.

There is no Group Box / Panel Box in iPhone.
You need to manage by your self.
Use the UITableView to put all the button in on category.
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UITableView_Class/Reference/Reference.html

It may be worthwhile to look into UIPopoverController views. These are the little popup views that appear when you click stuff. YOu could easily break your menu system into smaller parts with these.

You may draw a group panel by making two views. make a view of frame say 20,20,280,199 and then another one with frame 21,21,278,197. now put the 2nd view on the last one and change the color of last to some dark than later one. enjoy :)
remember that the should be in same hierarchy. that no one should be parent or child of any of these.

Related

XCode 4 Interface Builder: A better way to work with lots of overlapping views

In IB I have quite a few views that are shown. Many of them are hidden when the app loads, but are shown later when buttons are pressed. This is all fine, but when building this layout in IB it is extremely difficult to layout anything because there are so many overlapping views, some of which are partially transparent (ones that are set to hidden) and other are completely overlapping and covering others. This makes layout very hard.
What is the best method when laying out lots of views like this? Is there another way to break things up? Or better yet, can I hide a a view completely (like in photoshop) so that I can edit the ones underneath, then turn that layer back on?
Another option when trying to select a view that is obscured by another is the shortcut:
'ctrl' + 'shift' and click
It displays a list of all the views under the cursor.
I'm not aware of any way to hide objects in the canvas, but a useful trick for complex layouts is to double-click an item in the document tree to the left - this selects the item and puts focus on the canvas, you can the use the cursor keys to nudge it about.
This doesnt solve the problem of not being able to see things because there are, for example, five or six labels occupying the same space, but if that is the situation it may be a better idea to have a single label and change its contents in code.
I ran into this issue for an app I'm building that has an arial-view image of a park with clickable hotspots. When a hotspot is clicked a popup UIview is displayed with information about that spot in the park. I use the same VC/XIB for three parks. This makes the XIB really busy and hard to work with (i.e the same issue that you have) The detail UIViews make it hard to work with the views underneath. My workaround was to pick each detailed UIView that was hiding the part of the XIB I wanted to work on, and add 1000 to the UIView origin.x in the size inspector. This moved those UIViews enough out of the way for me to do what I needed to with the XIB. Then when I was done, I moved them back by x 1000. (I just needed to move them out horizontally to do what I needed to)
I know its clunky but given that XCode does not have a convenient way to hide portions of an XIB - it was the quickest approach I could think of!
One approach to handling overlapping items in IB is:
Ensure the groups of items that you want to hide are grouped into Views.
Give these Views names: e.g. ViewOptionA, ViewOptionB and ViewOptionC.
Can do this by clicking on name of view in the tree while it is selected and then typing new name.
When you want to hide one of those groups of items:
a) Select the View by either:
i) Clicking on it in the tree at the left or
ii) Ctrl-Shift Clicking in the layout editor and then select the view from the list.
b) In the Attributes Inspector set Alpha to 0.
When you want to unhide one of those groups of items:
As for 2) but set Alpha back to 1
[You do need to remember to unhide all views before you publish!
If you are forgetful like me then perhaps you could subclass UIView and set Alpha to 1. I haven't tried this subclassing idea yet.]

Sliding UITabBarItems in UITabBarController

I have a UITabBarController as my rootController with 8 UITabBarItems. and I want to show just 4 UITabBarItems in my screen. By default all my other tab bar items appear in a small tabBarItem called "More" and you can select the other 4. But I have seen some apps that implement a sliding UITabBarItems with a slide icon instead of a "More" icon.
How can I show just 4 at a moment, and I slide the TabBarItems, and so that I can select the other tab bar items ?
~ Something like this ~
And then I can slide to the next 4 sets by dragging
It would be helpful if someone could point me in the right direction.
There is a nifty little github project that could help you... check it out: https://github.com/iosdeveloper/InfiniTabBar
This is not currently a built-in option for UITabBarContoller.
One way to approach the problem is to add a UIGestureRecognizer to the tabBar.view, and programmatically adjust which 4 options are available on the screen. You can add an animation to make it smooth or have a little bounce as it slides.
iPhone users are usually very picky and attached to Apple's UI Guidelines. Although you can pass the Apple verification, you probably wont be able to pass users' (meaning bad reviews and ratings). So I recommend you to re-consider your tabbar structure and use "..." More instead of sliding it... You can always override stuff in code, but then they wont work smooth with InterfaceBuilder and in the end you will have more trouble than you'd expect.
If you have similar tab items merge them and use maybe a segmented control or something to visually distinguish them. Or use a central navigation screen in which you can put 9 maybe more icons in a grid...
The first solution to your problem may not always be the best way. Well, it is very rare actually...
You have to write a custom control for this.
I wrote one for showing a horizontal menu. You can probably modify that to fit your needs.
http://blog.mugunthkumar.com/coding/ios-control-mkhorizmenu/

What UI elements (objects) are used in livingsocial iPhone app?

I am new to iPhone development. I am using Titanium for developing but I guess that hardly concerns my question.
What UI elements where used to develop the certain pages of livingsocial? There are hardly 5-6 windows in the whole app.
a) For eg: if you see the main page(daily deals,escapes,purchases,settings) - did they use a window with a black background image & then added tableview to it for the four options? each tableviewrow has different images. Is that how it could be done?
Also if you notice the four options are scrollable but the heading livingsocial stays static & looks different from the native UI. How was that done?
b) If you look at sign in page (in settings) - they have two textfields & a sign in button inside a window. For the last element (Don't have an account?), is that again a tableview inside a scrollableview?
It would be great if someone can give a general outline as to how they developed their app & what UI objects we used.
edit: please find the screen shots :
a)http://dl.dropbox.com/u/9556373/IMG_0616.PNG b)http://dl.dropbox.com/u/9556373/IMG_0620.PNG
a) For eg: if you see the main page(daily deals,escapes,purchases,settings) - did they use a window with a black background image & then added tableview to it for the four options? each tableviewrow has different images. Is that how it could be done?
Also if you notice the four options are scrollable but the heading livingsocial stays static & looks different from the native UI. How was that done?
That app uses a custom made UINavigationController (for the static bar at the top, that can accommodate the title of the view and different buttons depending on the view currently showing, namely a back button for returning to the main view) and UITableView with custom made cells.
b) If you look at sign in page (in settings) - they have two textfields & a sign in button inside a window. For the last element (Don't have an account?), is that again a tableview inside a scrollableview?
No, I think that's a UIButton, that just happens to look like an isolated cell. Also, that view doesn't look like its scrollable.
I'm not familiarized with Titanium, so I can't give you any directions there. But keep in mind that using custom controls usually takes more effort than simply using apple's own default.
In answer to your first question:
I'd use a tableview for that, with custom made cells to create that look. If it is not a main window on your tab you'll have to remove the 'back' button, otherwise it'll be fine.
In answer to your second question
The first 2 are textfields. The rest are all buttons (and the text above facebook button is a label).
If you're using titanium you could take a look at the kitchensink example.
Hope this helps!
Tjellekes

Iphone Toolbar Icon with Dynamic Count

I've done a lot of googling and am at the end of my rope so here goes ... I just need to know if this is possible so I can design a series of screens for an Iphone app.
In my app you are able to leave comments on a certain topic, I would like an icon in the toolbar that displays a word bubble with a plus sign in the center when there are no existing comments and if there are existing comments I would like to display the same word bubble but instead of the plus I want to show the number of existing notes programatically.
Is this possible?
thank you
Yes, it's possible. You populate a toolbar with UIBarButtonItem instances. You can create one of these using
-(id) initWithCustomView:(UIView *)myCustomView;
In your custom view, you can put any graphics you want, including a plus sign, or a subview with a UILabel that shows the number of comments.
When the status changes (comments are added or removed), you just need to create a new UIView and set the toolbar.customView to that view.

distribute option in interface builder of iPhone

i have following buttons in my application.
Now i want to set equal spacing among all buttons.
Suppose If I am using corelDraw or Photoshop, there is always an option for align & distribute.
Here I need to distribute my objects vertically.
How is that possible in interface builder of iPhone?
Sample image is given below, in which distribution is required.
alt text http://img268.imageshack.us/img268/4146/problem13.png
I know this post is ages ago, but for the sake of simplicity (maybe) and to avoid using table views (for sure)...
In your example, if you select the first UIButton, keyword, and press option key, interface builder shows you the relative distance from the center to any other object you hover with the mouse. So if you decide the optimal distance is the one between keyword and category buttons, you can apply that distance for the rest of objects simply adding or substracting the appropriate amount of pixels from the button size inspector.
Hope it helps!
Depending on the type of object, you might do this.
Select all implied objects.
Select Editor->Embed in->Matrix;
this will place the objects regularly.
Then select the option Editor->Unembed
and the objects will keep their new positions. Hope this helps!
I dont think there an option to do it automatically, you can do some math though and get them to have equal spacing by setting their frames...
Another option is to place all of these in a table (since they look like table view cells anyway), and adjust an empty footer view height to get the spacing you want between elements.
Of course that means you don't get to view the layout in IB.
It's even simpler - Simply drag a "Flexible Space Bar Button Item" from the Object Library in Xcode into each gap. It will automatically expand to equispace your other items.
&