Mimic iOS GameCenter UI? - iphone

I would like to know that how can we mimic the UI of iOS game center app? It has a very cool interface. I wonder how they are drawing text, Custom Tab Bar Controller etc.

Creating a custom UITabBarController like that of Game Center is possibly the hardest of all iOS customisation techniques, and will more than likely need a complete custom component building from scratch. Unfortunately Apple do not want you to mess with the UITabBarController much.
See this answer iOS TabBar Image assignment for how to change the tint color of the tab bar.
The rest is fairly straight forward and can be found out about on here, custom UINavigationItem for the UINavigationBar and basic UIWebView and UILabels will help you achieve everything else.
Hope this helps

I found the best approach was to create my own tab bar controller.
While it's not trivial, it is straightforward once you attempt it. For the "tab bar", I used a plain UIView. Inside the UIView I placed a UIImageView (to hold the tab bar background image--can be anything you want) and several UIButtons (for each tab button--very customizable since each is a UIButton). Doing it this way lets you do anything you want in terms of tab bar appearance.
You can use this trick to customize your nav bar background
-(void)styleNavBar:(CGImageRef)backgroundImage
{
navBar.layer.contents = (id)backgroundImage ;
}
Also, for custom nav bar buttons:
UIButton * customButton ; // your custom left or right nav bar button
// put it into a bar button item:
UIBarButtonItem * barButtonItem = [ [ UIBarButtonItem alloc ] initWithCustomView:customButton ] ;
That should be a good start!

Related

Showing a overlaying menu when tab bar item is clicked - IOS

Thanks for reading my question!
I have a 5-part tabbar which I use for app navigation, the center tab is covered by a UIButton and is slightly larger (much like the instagram app). This works fine.
But what I want is the far right tab bar item to show a overlaying menu when clicked. I don't want it to switch to a viewcontroller with a menu. I want the menu to be displayed no matter which of the other views you're in at the moment. So I want it to act much like a button which is in the tabbar. But I have no idea how to go about doing this.
Should I use a overlaying button over the tabbaritem or should I catch the tabbarclick, but how can I prevent the view from changing in that case?
Thanks you for any help!
You need to implement UITabBarDelegate. Then override tabBar:didSelectItem: and implement your custom displaying here. See below for reference
http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITabBarDelegate_Protocol/Reference/Reference.html
Then i would just make a custom UIView and fade it in when that specific tagged UITabBarItem is pressed.

using UINavigationBar without UINavigationController

I want a UINavigationBar at the top of my UIWebView but I want to control by hand the title, the back button, what the back button does - etc. In other words I never want to push or pop views. I just want to change the UINavigationBar contents as the user clicks around the web view.
Where I'm up to is I added the UINavigationBar to my superView and made it 44 pixels tall. How do I set the title since I have no navigationItem? How would I set a fake back button up?
I would appreciate any pointers. I realise this is quite weird what I'm doing.
Thanks :)
The answer, if anyone's interested, is in the class reference of UINavigationBar.
When you use a navigation bar as a standalone object, you are
responsible for providing its contents. Unlike other types of views,
you do not add subviews to a navigation bar directly. Instead, you use
a navigation item (an instance of the UINavigationItem class) to
specify what buttons or custom views you want displayed. A navigation
item has properties for specifying views on the left, right, and
center of the navigation bar and for specifying a custom prompt
string.
In short, use a UINavigationItem and apply it by "pushNavigationItem" on the UINavigationBar.
I created a subclass of UINavigationBar called StaticNavigationBar which I can then load with any state by putting the appropriate UINavigationItem's on it. Thanks for all your answers people.
You can have that UINavigationBar as an outlet and then you can manupulate it as you want. So you don't have to refer to somebody's navigation item. It'll be an independent (sort of) object on your view.
If you dont want the navigationbar as-is youll have to roll your own.
if youre ok with the built in animations for pushing and popping items(dont confuse with push/pop of viewcontrollers) to the bar you would then set your UINavigationBarDelegate and use its methods for controlling how things push/pop, etc.

flip animation for right navigation bar button item

What is the best way to have the right navigation bar button flip like it does in the ipod when one changes from list view to single song view? Subclass a custom view? Are there any api's out there that already do this?
thanks
This question is similar, and discusses a few solutions. The main issue is that the UIBarButtonItem isn't a UIView, so you can't use the UIView transitions. iPhone flip right button (like iTunes)

How to make a UIBarButtonItem look like a UINavigationBarItem

I have an iPad application with screen flows which don't map neatly to the navigation controller model, but still have the concept of "Back".
I'd like to manage my own toolbar and have a "Back" button where I decide where it goes.
Is there a way to make a toolbar button have the look of a back button as in UINavigationBarItem?
Thanks
Basically, you either have to use undocumented APIs, or create a custom button with a custom image.
This question:
Creating a left-arrow button (like UINavigationBar's "back" style) on a UIToolbar
has answers that cover both ways.
(Placing a UINavigationBar back button look alike icon somewhere other than the left of what looks like a UINavigationBar is probably against the HIG and may result in non-approval of the application, though perhaps only if you're unlucky.)

Custom UITabBarController - using a UIToolBar with UISegmentedcontrol as Tab Bar?

My customer wants a design-change, but I just can't figure out how to do this!
The app currently have a UITabBarController shifting between some UINavigationController's. My customer wants to use a UIToolBar with a UISegmentedControl shifting between the controllers instead.
I want to keep the UITabBarController, because that takes care of everything regarding loading and shifting views, but I want the UIToolBar to act as the UITabBar instead of the UITabBar!
I have allready figured out that I will need a custom UITabBarController and possibly a custom UIToolBar as well.
But I have absolutely no idea of where to start, so it would be great if somebody could give me a pointer as to where to start.
Top part to act as bottom part. http://files.droplr.com.s3.amazonaws.com/files/14763142/1g5g1s.Skjermbilde%202010-06-25%20kl.%2012.24.59.png
Thank you.
If I understand your requirements correctly, you want to have a UIToolbar at the bottom of the screen that has a UISegmentedControl that replaces pressing UITabBarItem's to switch between different views and view controllers? Assuming this is true I'd start with a custom UIToolbar class, say SegmentedControlToolbar that mirrors the basic behaviour of UITabBarController and UITabBar to add items to a segmented control, attach view controllers to each segment, and finally handle presses for each segmented control change to actually switch views.