NavigationBar clipping background image in iOS7 ;ClipsToBound:NO not working - ios

I have set a background image slightly bigger than the navigationBar.The image is 55px in height.[I want a banner looking image with ribbon at the bottom of nav bar]
It was working ok in iOS6.
But in iOS7, its getting clipped by itself.
I tried setting
[self.navigationController.navigationBar setClipsToBounds:NO];
It's still getting clipped.
Can't I have a bigger background image without getting clipped?

this is due to Ui navigation bar is 64 point in ios7 that why this create problem.
refer this link https://developer.apple.com/library/ios/documentation/userexperience/conceptual/transitionguide/Bars.html refer table 5-1 that is give you idea that for resizable image what are the change in new ios7
you can use UIBarPositioning propety to solve your problem not sure but that may help you
refer this link for more info related to UIBarPositioning
https://developer.apple.com/library/ios/documentation/uikit/reference/UIBarPositioning_Protocol/Reference/Reference.html#//apple_ref/occ/intfp/UIBarPositioning/barPosition
Edited
also try by set this flag
navigationBar.translucent = NO;
for more info refer this link
iOS 7 UINavigationBar - UIView layout issue

The image is not getting clipped, it is most probably just too small.
The UINavigationBar is 64 points in iOS 7, so the 55px image will be too small, especially considering the retina resolution where 128px would be needed.

set the delegate of your navigation bar to your view controller, and return UIBarPositionTopAttached in delegate method. return the position which you want to see
- (UIBarPosition)positionForBar:(id<UIBarPositioning>)bar
https://developer.apple.com/library/ios/documentation/uikit/reference/UIBarPositioning_Protocol/Reference/Reference.html#//apple_ref/occ/intf/UIBarPositioning

Related

UISplitView – multitask, navigationItem's titleView missing after resizing

I am having a very weird problem for iPad's multi-tasking resizing. This is how i set up my titleView:
navigationItem.titleView = theView
And I resize the SplitView in iPad multi-tasking so I can have two apps running side by side. After a few size changing, my titleview is missing from the UI.
Debugging it from the log, it is still in the navigationItem's titleview hierarchy but just not showing?
Any ideas?
I am having the exact same issue and have yet to find a resolution. When using the title property it works great, but using titleView the view will disappear at times when changing sizes when multitasking.
I found the following seems to have fixed my issue:
Assuming the view you want to place as the title view on the navigation item is declared as self.titleView:
[self.titleView.widthAnchor constraintEqualToConstant:44.0].active = true;
Hope that helps anyone else looking for the same thing.
I found this via this article:
Custom title view as large title in iOS 11 new navigation bar

iOS Blur Background like iTunes Remote App

I'm new here so please bear with me.
Can you please help me make a transparent blured background like the one used in iTunes Remote iOS7 app in the store? Also, how is the text masked?
Screenshot here:
(source: rackcdn.com)
I found the "UIImage+ImageEffect" class made by Apple, in a WWDC example Apple posted here: https://developer.apple.com/downloads/index.action?name=WWDC%202013#.
Using this class, is's really simple to blur an image with this code: [image applyLightEffect]
where image as an instance of UIImage.
Here are the steps i took to make the text look like it's "cut" from the background view. Use this layering order:
Blurred Image
View with lower opacity (ex 80%) filled with a color. I used a white background color.
2.1. Set a label as a child of this view and set the tint color to Black.
Add any other content you want on top.
And voila! It magically works!
Use UIToolBar of UIKit framework which automatically comes with blur and transparent effect on background view (live).
Reason - Since UIToolBar inherits UIView so fundamentally there is no issue in using it in place of UIView.

Background color (colorWithPatternImage) not filling entire view for iPad

I am trying to set the background color with a checkered image I have. I am currently using this in my iPhone app and now am trying to create a universal app. When I use this:
UIImage *bgimg = [UIImage imageNamed:#"square_bg.png"];
self.view.backgroundColor = [UIColor colorWithPatternImage:bgimg];
It works fine for my iPhone app. When it loads on the iPad in portrait mode, there is about 20px worth of white space at the bottom. When it loads in landscape, it is fine. If I rotate from portrait to landscape, then back again, it is also fine.
What am I missing that will fill the pattern all the way to the bottom of my view?
Update
If I set the color to a solid color, [UIColor blueColor], the entire screen fills in correctly. So why the discrepancy from colorWithPatternImage and a solid color?
Update 2
The file I am using is a PNG file with dimensions of 252x230. I've used this image to make patterns in the iPhone version of this app with no issues. I'm not sure if the file size or dimensions have any bearing on this issue, but I thought I would put it out there just in case.
Perhaps the view is not set to the correct height. If you change backgroundColor to a solid color will it fill the entire screen?
20px sounds like the status bar height. Could you tell us the view frame?
Is your autoresizing set correctly to dynamic width & height and fixed borders?

What are the iOS specifications / guidelines for navigation bar background images?

Does anyone know the iOS image resolutions for navigation bar backgrounds? I’ve found the resolutions for pretty much all the other elements on Apple’s Custom Icon and Image Creation Guidelines page, but I couldn’t seem to find anything for pixel sizes requirements for navigation bar background images (both regular and retina).
The iOS navigation bar is 44 pixels tall and 320 pixels wide. On Retina displays, those numbers are double, at 88 pixels and 640 pixels respectively.
The navigation bar is 44 pixels tall. You can check the dimensions of any iOS UI element by creating one in interface builder and clicking on the size inspector (the ruler).
Note there is an issue I reported here. It seems you cannot set width and insets of a bar button item image on a navigation item from within IB size inspector nor programmatically, they simply have no effect. You can do so for a bar button item on the toolbar though. This seems to be a bug.
By the way here is the link to Apple Icon and Image Creation Guidelines.
Apple does not support api for setting background image of NavigationBar.
You can only set tintColor.
Or you can subclass and implement the - (void) drawRect:(CGRect)rect method.

UISearchDisplayController gray overlay not fully covering table

I'm having an issue where the gray overlay that's automatically put over my UISearchDisplayController when the keyboard is shown doesn't always fully cover the table area (you can see the white on the bottom in the picture below). This doesn't always happen but it's frequent enough that it's annoying. Anyone know what's going on? Thanks.
I believe this is a bug in Apple's code. Having worked extensively with UIPopoverControllers, I have found that there are many occasions in which a popover becomes confused as to whether or not it has a navigation bar when performing sizing calculations.
I am confident that if you measure the height of the white box you will find that it is exactly 37 pixels: the height of a navigation bar in a popover. (Navigation bars in popovers are not 44 pixels high like most navigation controllers since they are embedded into the popover's border.)
If you were able to access the gray overlay and manually resize it you could account for the height of the navigation bar or lack thereof. Unfortunately you are in a bit of a bind since the overlay is controlled by the search bar.
My suggestion would be to try to get the popover to recompute the size of its contents after it appears or is resized. I use this pattern when dynamically resizing a UIPopover containing a navigation bar when it appears:
// UIViewController subclass with a navigation bar which is displayed in a popover
// _popoverController is a (unretained) pointer to the UIPopoverController in which this view controller is displayed
- (void)viewDidLoad
{
[self.view sizeToFit];
CGSize newSize; // Dynamically computed based on popover contents
self.contentSizeForViewInPopover = newSize;
newSize.height += 37; // Account for popover navigation bar
[_popoverController setPopoverContentSize:size animated:YES];
}
I don't know how much this answer will help, but I hope it will at least give you a push in the right direction.
Have a look in this post: http://www.cannonade.net/blog.php?id=1498
He discusses the problem, providing a (called by himself) ugly workaround, but also says how to fix it!

Resources