Resize UIToolbar will be reject in App Store? - ios

i think it not use private API , it will be rejected?
self.navigationController.toolbar.frame =
CGRectMake(self.navigationController.toolbar.frame.origin.x,
self.navigationController.toolbar.frame.origin.y,
self.navigationController.toolbar.frame.size.width, 60);

apple says u wont by programatically.
Guidelines
Use a toolbar to provide a set of actions users can take in the current context.
Use a toolbar to give people a selection of frequently used commands that make sense in the current context. An alternative is to put a segmented control in a toolbar to give people access to different perspectives on your application’s data or to different application modes (for usage guidelines, see “Segmented Control”).
Maintain a hit target area of at least 44 x 44 points for each toolbar item. If you crowd toolbar items too closely together, people have difficulty tapping the one they want.
Use system-provided toolbar items according to their documented meaning. See “Standard Buttons for Use in Toolbars and Navigation Bars” for more information. If you decide to create your own toolbar items, see “Icons for Navigation Bars, Toolbars, and Tab Bars” for advice on how to design them.
Try to avoid mixing plain style (borderless) and bordered toolbar items in the same toolbar. You can use either style in a toolbar, but mixing them does not usually look good.
Specify the color or translucency of a toolbar, when appropriate. If you want the toolbar to coordinate with the overall look of your app, you can specify a custom color. You can make a toolbar translucent if you want to encourage people to pay more attention to the content underneath the bar. Make sure the toolbar customization you do is consistent with the look of the rest of your application. If you use a translucent toolbar, for example, don’t combine it with an opaque navigation bar. And, avoid changing the color or translucency of the toolbar in different screens in the same orientation.
On iPhone, take into account the automatic change in toolbar height that occurs on device rotation. In particular, make sure your custom toolbar icons fit well in the thinner bar that appears in landscape orientation. Don’t specify the height of a toolbar programmatically.
http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW33

Related

Best approach for creating this custom UINavigationbar ios

I am creating a UINavigationBar that will expand and contract in various states. The top image is when it is in a contracted state with a transparent background. The lower image represents when it has expanded with a background and search bar. As the user scrolls down the nav bar background would animate in and expose the search field.
Can someone suggest the best way to build this?
So far I've explored subclassing the UINavigationBar, but I've been having a really tough time with the placement of the items within the nav bar or hooking that view up to a xib. I've also see examples where the extended content is just a UIview anchored to the top of the view controller top margin, but then I'm splitting the appearance of my nav into two views which will make the animation problematic.
According to the answer to UISegmentedControl below UINavigationbar in iOS 7 it can be accomplished using a UIToolBar and some delegate methods.
You might have to tweak it a little bit however, to fit the search bar that you want to include.

Blur top bar to UIView

I made a "single view" app with a UIView interface in a .xib file. I added a navigation bar at the top with some buttons on it and all worked fine in iOS 6.
With Xcode 5 my navigation bar is too short and buttons overlapped status bar. I tried to add a "top bar" in the "Simulated Metrics" panel but once I run the app the bar does not appear (even if it appears in the .xib file during editing).
Same problem when I tried a tool bar because I need a 64 pixel (instead 44) high blur bar.
Does a simple solution to this problem exist? Thanks!
Simulated metrics, while editing a storyboard and/or xib are, are there for you to use when stubbing out your design. They will not show up at run time. Think of them as fictional representations or a prototype of what you would like to see in your design without actually having to implement it yet.
IE: You're not sure if you want a UINavigationBar in your design. You can layout your design with the UINavigationBar turned on in the simulated metrics and it'll show you what it looks like, but only in the editor not actual run time, and from there you can make your decision on whether or not to keep it or rearrange your other controls. Something like this is very handy if you create your UINavigationBar programmatically (like I do). If I simulate the UINavigationBar (even though I'll create it programmatically) then I can get a much better idea of where to layout all my other controls that I DO setup in IB.
All that being said, if you layout all your xib's and SB's in the interface builder then the simulated metrics really is worthless to you for the most part because you can obviously just drag and drop the control onto your xib.
Hope this helps!

Scaling entire iPad app to fit status bar

I've been searching SO and Google for a while now with no luck.
What I need to do, is in certain conditions, display a status bar at the top of my application.
When this bar shows, I need to shrink all the other content down so everything still fits on the screen.
I know I can use CGAffineTransformScale, however, I am not having any luck doing it globally for the entire app.
I'm sure I'm missing something obvious. Guess my lack of experience is showing.
Thanks
EDIT: The 'status' bar I'm referring to is NOT the standard iOS status bar. It is a custom status bar that appears only in certain conditions and sits at the top of the app.
I would check your autolayout settings on the first view you added to the controller - if you have them setup correctly then it should resize automatically.
If you use a UIViewController or any concrete subclass of that, its view should automatically adapt to whether or not the status bar is currently visible.
Now in case you use autoresizing masks, your UI should be fine. Same should apply if you use a UIScrollView.
Alternatively: In Interface Builder, select your view controller and on the attributes inspector turn off Layout: Wants Full Screen. Then, your layout will automatically adjust its size to make room for the navigation bar.

Is there a way to adjust the width of UITabBar button items to fit more than 5 buttons on the screen?

My buttons seem stretched, especially in landscape orientation. I can't find a property to adjust either on the UITabBar, UITabBarViewController, or on the UITabBarItem's themselves. (Of course, one answer would be to get an iPad...but that doesn't solve the need for a phone.)
For example, consider this simple Tab Bar Example - if I only could set the tab bar to auto-shrink as more buttons are added, or manually adjust the width to fit them all on the tab bar, I would be happy.
It is not possible to use the UITabbar with more than five visible buttons. You've got to write your own component.
Here at significantpixels.com / The iPhone Tab Bar Lessons From Reality is an article about the tab bar which explains in detail how to design your tab bar from a UX point of view. And the magic number of tabs is five ;)

iPad Toolbar UI Question

I need to have an iPad app that has a consistent toolbar at the top of the screen. I need it to adjust when switch from landscape to portrait. Essentially what I need is something that acts like a UINavigationController, but allows me to have an arbitrary number of buttons like a UIToolbar. I've seen this done, but I can't figure out how to do it.
Thanks
There is no reason you can't just use a standard UIToolbar at the top of the screen, rather than the bottom. This allows you to add as many buttons as you can squeeze on, and customise their appearance.
In order that it should adjust its size when switching interface orientation, you simply need to adjust its autoresizingMask property. This is easy in Interface Builder - just turn on the horizontal arrow in the middle of the autoresizing box (this makes the width flexible), and maybe make sure that the left, right and top struts are enabled to so as to hold it in the correct position.

Resources