iOS 7 Uitoolbar Overriding with Status Bar

iOS 7 UIToolBar Overriding With Status Bar

If your setup is a split view like setup with two container views, you should be able to do this. When you set up the container views, drag the top up until you see the dotted blue line that indicates the top is at the bottom of the status bar. Do this with both container views. Add the tool bar to the embedded controller (not the container view), pinned to the top of that controller's view. With the left view being embedded in a navigation controller, my screen looked like this:

Sample Image

iOS 7 | Navigation bar / Toolbar buttons very close to status bar

The navigation bars or toolbars have to be at (0, viewController.topLayoutGuide.length) with bar positioning of UIBarPositionTopAttached. You should set the delegate of your navigation bar or your toolbar to your view controller, and return UIBarPositionTopAttached. If positioned correctly, you will have the result in your third image.

More information here:
https://developer.apple.com/documentation/uikit/uibarpositioningdelegate?language=objc

UIToolbar style on iOS7

Try:

 toolBar.tintColor = [UIColor blackColor];

Remove UIToolbar hairline in iOS 7

If you set youBar.clipsToBounds = YES, the hairline disappear.

Hope this help.

[EDIT]

For the navigationBar bottom hairline, the solution here https://stackoverflow.com/a/18180330/2011578 also works great.

UIToolbar - Allow interaction below toolbar

You can set userInteractionEnabled = YES on the toolbar, but override hitTest:point as described in How to get touches when parent view has userInteractionEnabled set to NO in iOS. This makes it ignore any touches on itself, but accept any touches on any subviews (UIBarButtonItems in your case):

- (id)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
id hitView = [super hitTest:point withEvent:event];

if (hitView == self) {
return nil;

} else {
return hitView;
}
}

Note that this would require you to subclass UIToolbar.

inputAccessoryView's UIToolbar turns black when rotating in iOS

Fixed by adding: (still unclear about the reason causing it though)

keyBoardToolBar.isTranslucent = false
keyBoardToolBar.barTintColor = UIColor(colorLiteralRed: (247/255), green: (247/255), blue: (247/255), alpha: 1)

(UIColor(colorLiteralRed: (247/255), green: (247/255), blue: (247/255), alpha: 1) is the default background color of the UIToolBar from here)

On iOS 7, pushing a controller with a toolbar leaves a gap of unusable space if it's ultimately contained within a tab bar controller

Uncheck "Hide bottoms bars on push" and set your autoconstraints as if there is a tab bar. Then in "ViewDidLoad" of the controller you want to hide the system tab bar, put the following code.

[self.tabBarController.tabBar setFrame:CGRectZero];

This makes sure the tab bar still accepts user interaction yet not visible to users. (other alternatives such as setting it 0 alpha or hidden will render tab bar useless) Now the autoconstaraints will make sure your view displays correctly with the tab bar height as zero.



Related Topics



Leave a reply



Submit