Sliding UITabBarItems in UITabBarController - iphone

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/

Related

Is it possible to move the tab bar to left and right direction in iPhone

Im developing a tabbar application.
There are almost 7 tabs in this app.
Usuall when we add more than 5 tabs a "more button"will come and rest of options will come under that "More option".
But i found a very interesting app in app store and they are moving the tabbar to left and right(just like we do in scroll view) like in the image below.
How can i implement this.
Can anyone help me with this please.
Thanks in advance.
As far as I can see, it's 2 custom UIButtons placed over the tabBar that may programmatically rearrange the tab options on their IBActions. What makes me say that is that the highlighted area of the last tab is just normal, and the arrows does not seem as well placed as what Apple could have done by standard.
You can use custom tabBar, like InfiniTabBar, nice and functional.
Project on GitHub:
https://github.com/iosdeveloper/InfiniTabBar

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.]

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 panel control

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.

Tab Like Selection

Can anybody please tell me how they have implemented the below thing whick looks to me like a TabBar but has something different from a simple tabbar.
The thing having "Offer" and "Wall", when each one is clicked, presents a different view.
Any sample code will be appreciated
Its a custom UIButton.
EDIT: What UI element might this be? (Custom tab-bar?). I had asked the same question a few weeks ago. There are two good answers there.
And google up for custom UIButton. You can find a few samples on your search
Its a custom view. You can always implement this kind of thing by using images. Say you have 2 different images. In one image offer is selected, and in another wall is selected. And you are using an image view to show them. An invisible button is placed in proper place. After tapping the button you can set the right image. And also if the images are not overlapping then you can use custom button.