White space after moving uitabbar to the top - iphone

I use UINavigationcontroller inside UITabBarController and I have moved the UITabBar to the top .The UITabBar has moved successfully but the problem is, there is about 50px of white space where the tab bar used to be .
Anyone has a solution to this problem????

loop through the subviews of the tabbarcontroller.view until you find the container for the tabbar's inner views, then set the frame of that view to 50px higher than it currently is.
Alternatively, a better solution is not to try and use a tabbarcontroller this way. Just use a standalone UITabBar and implement your own view swapping logic when the tabs are tapped.

Uncheck extended edges in rectangle.

Related

How to add an image view sharing between navigation bar and view?

I had to add an image so that half of it is in the navigation bar and remaining is in the view.I know there is always a probability of adding two images,but i want to know is there any way to add an image view(only one)between the two?Now i know i can do this way ,
[self.navigationController.navigationBar addSubview:imageView];
and also self.view addSubview:imageView,but i need a single image view to be shared between the two
ie the first half is in navigation bar and the remaning is in the view.can anybody help me on this?
No, this is not possible AFAIK. A view (including a UIImageView) can only have one superview. SO it's either a child of the UINavigationBar or one of the other view, but not both.
with ios 7 you can use translucent navigations bars so that you can set the imageview in your view and it shines through the navbar :-)

Making the tab bar scrollable in iphone?

I have an Iphone application in which I had 10 tab items in the tab bar.
I don't want to add the more button behaviour of the tab bar here.
Instead of that I need to make my tab bar as scrollable.
Can anybody had the idea or links to illustrate this?
Can anybody guide me in the right direction?
But You can not use the UITabbar. You need to create custom UITabbar that behave the same.
Here are links of some projects will help you more.
Infinte Tab Bar
Scrollable Tab Bar
Have you tried looking here?
How to make a horizontal scrollable UITabBar in iOS?
Although, and this is the reason im not writing a comment, i would not use a scrollview, as described in the accepted answer. Instead, i would go for a uipickerview, and rotate it 90 degrees using CGAffineTransformRotate. Let me know if this works.
1) define UIScrollview *scrollview
2) drag and drop scroll view
3) connect instance and delegate in xib
4) set frame of scrollview more so it is scrollable and more than view size
5) add uitabbar as subview to scrollview
[uitabar instance addsubview:scrollview];

UISegmentedControl inside UIToolbar does have wrong height for Lanfscape

Somehow the Segmented Control does not get the proper height when the iPhone is in Landscape.
It is already bad enough when rotating the simulator that the toolbar at the bottom doesn't get thinner height, but when navigating back to the previous screen and then in again, the toolbar does get the propper height, but the segmented control extends above it, and even looks much bigger.
Is the is bug in the simulator or am i doing something wrong?
After digging around another day, I found where it all went wrong!
When dealing with UINavigationControllers, DO NOT drag in a UIToolbar at all! UINavigationController comes with two bars, a top-bar for the Navigation Controller and a bottom-bar for the ToolBar - that latter one is hidden by default.
In any newly added ViewControllers, there will be a toolbar that can be populated from the IB. However, if it is not a UIBarButton, there are some issues. To use a stepper, on/off-switch or a segmented control, drag it first to the Navigation bar, and then in the left column navigator of IB, drag it to the toolbar.
This solved all the problems mentioned before

Programmatically center icons in a TabBarItem in a UITabBarController

I'm programmatically generating a UITabBarController (instantiating view controllers and assigning them to my UITabBarController's viewControllers array). I don't want titles for my TabBarItems. However, the TabBarItems by default make space for a title, so my icon images are centered 5 pixels higher than they should be. Is there a programmatic way to "center" i.e. shift or give offsets to the TabBarItem's image?
You can use the imageInsets property to move the frame of the icon.
Unfortunately, there isn't a way to do this (and even if you managed to cheat and find a way to shift this stuff down it would no doubt be denied by Apple during the approval process).

Resizing view to display over hidden uitabbar in iPhone

I have an uitabbarcontroller which contains a couple uiViewControllers.
When i show one of those controllers i am hiding the tabbar. This view has a fullscreen uiimageView. The thing is i am seeing a white rectangle over where the tabbar is hidden.
I have tried resizing the views but the white rectangle is still there. Any ideas? Thanks
Fullscreen in the tabbar or for the entire viewport of the device? The rectangle is there because one of your views is not positioned correctly.
Validate that your UITabBarController and/or UIViewController is set to the correct size and the correct position on the screen.