Popover resizing broken in iOS 5.1 - ios5

I have a popover in an app and it doesn't resize to what I set. I found this but it still doesn't work in iOS 5.1. I switched to the ios 5.0 simulator and it worked again. Am I missing something?
EDIT
In viewDidLoad:
self.contentSizeForViewInPopover = CGSizeMake(320.0, 137.0);
In viewDidAppear:
self.popoverController.popoverContentSize = CGSizeMake(320.0, 137.0);

Looks like it has to be a "bug" or a change in iOS 5.1. Apple's sample code does not do a popover in a splitview. I have disabled the swipe gesture though by calling setPresentsWithGesture on the splitViewController. It is annoying swiping and having the master view come up.

Related

How can I change a UIBarButtonItem's TintColor when building for iOS 6.1 and running under iOS 7?

I have an iOS app compiled using the 6.1 SDK with some UIBarButtonItems where the TintColor is set programmatically in ViewWillAppear.
UIBarButtonItem leftButton = new UIBarButtonItem(...);
leftButton.TintColor = UIColor.FromRGB(231, 231, 231);
Resulting in this.
I've upgraded my iPhone to 7.0 but I still need to build for the 6.1 SDK for backwards device compatibility (business reasons).
When I build the app using the 6.1 SDK and run it on an iPhone running iOS 7.0, the toolbar looks like this.
Having read through the iOS 7 UI Transition Guide, I tried setting the UIWindow's TintColor to see if this had an effect. It did not.
On interesting thing - on this form, when I display an ActionSheet, after the ActionSheet is dismissed, the background of the Cancel and Save buttons changes from "black" to "white". I'm currently investigating why this happens.
If I can't change the TintColor programmatically under iOS 7.0 I'm thinking of creating custom background images for the buttons, like this.
And use SetBackgroundImage to override the existing background.
Thanks in advance.
Update - 09.24.13
poupou's answer pointed me to the WWDC video (link) which gave me the solution at 8:37 - I need to set the navigation bar's TintColor instead of setting the specific button's TintColor.
NavigationBar.TintColor = UIColor.FromRGB(231, 231, 231);
I tried setting the UIWindow's TintColor to see if this had an effect. It did not.
It should - but if you're setting TintColor on some other UI elements then it will have priority over the one set on the main UIWindow.
There's a whole session of WWDC 2013 (session 214) about TintColor and how it works in iOS7 (that's the one with the Tic Tac Toe sample).
If you need to run/exclude some code specific to an iOS version you can do:
if (UIDevice.CurrentDevice.CheckSystemVersion (7,0)) {
// iOS 7.0 and later
} else {
// iOS 6.1 and earlier
}

Scroll view doesn't visible when i am using removeFromSuperview in xcode 5 (ios 6.1 simulator)

I am using xcode 5. when i was run app from xcode 5 for ios 6.1 simulator then scroll view doesn' see. for ios 7.0 simulator .Before it was working. I am using interface builder
You can see in following image.....
In ios 7.0 simulator it is working
In ios 6.1 simulator It is Totally white
![It is totally White][2]
In my scroll view view controller in viewDidLoad method i have write below code
[scrollView removeFromSuperview];
[self.view addSubview:scrollView];
When I comment above code then scrollview is visible For ios 6.1 simulator
![enter image description here][3]
Seriously I dont know what is the actual reason? is that above reason or not. In xcode 4.6 it was working .Also my app is live on appstore . Please help me .
Thanks in advance
Seems that You have issue with memory management or with position/size of scrollView. Try to set breakpoint and check what heppends with Your object.
#Kalpesh its simply because removeFromSuperview doesn't work in iOS 7. So your scrollView was not removed (if you had touched the screen it would have crashed). But [scrollView removeFromSuperView]; removed the scrollView in iOS 6 .

iOS 7 Default image overlapped by status bar in multi-tasking view

My app is compiled against iOS 6 SDK (haven't gotten the time to upgrade to iOS 7 SDK). So I just noticed that the Default image is overlapped by the status bar. This seems to happen only in the "multi-tasking" view but not when resuming my app from background for some reason.
See this image:
I don't think many people will notice this at all.
However, as far as I know you could possibly disable the Statusbar when the app gets in backround.
To do this just use this method in the delegate:
- (void)applicationWillResignActive:(UIApplication *)application {
//code to disable statusbar
}
In the applicationDidBecomeActive method you could enable the statusbar again.
- (void)applicationDidBecomeActive:(UIApplication *)application {
//code to enable the statusbar
}
Furthermore you can take a look at this previous asked question: Status bar won't disappear
If you got any questions feel free to ask!
edgesForExtendedLayout does the trick for iOS 7. However, if you build the app across iOS 7 SDK and deploy it in iOS 6, the navigation bar appears translucent and the views go beneath it. So, to fix it for both iOS 7 as well as for iOS 6 do this:
self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
if ([self respondsToSelector:#selector(edgesForExtendedLayout)])
self.edgesForExtendedLayout = UIRectEdgeNone; // iOS 7

View size and position for iOS7

I am having a weird problem in iOS7 and iOS6. If anyone could help me out.
Problem :
- in iOS6 and earlier the view coordinates starts after NavigationBar but in iOS7 the view coordinates starts after StatusBar and calculate NavigationBar in the View. So what ever looks fine in iOS6 will spoil in iOS7. The NavigationBar hides the top 44 px of the View in iOS7.
I tried to search on internet but could not find any proper solution. I can pragmatically arrange the views by iOS7 condition. But I know its not a proper way to do it. So if you know how to resolve this issue, please guide me. I have attached 2 screenshots one is from iOS6 and the other is iOS7 so you get a better idea of the problem.
Although iOS 7 is still in beta phase. But according to current docs, you can check the version and load your components accordingly. See this link ( You need to login to developer portal first ).
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
// Load resources for iOS 6.1 or earlier
} else {
// Load resources for iOS 7 or later
}

Using EGOPhotoViewController with iPhone 5

Using this on iPhone 5:
EGOPhotoViewController *photoController = [[EGOPhotoViewController alloc] initWithImageURLs:imageURLs];
[self.navigationController pushViewController:photoController animated:YES];
When I get back to the caller I can see the bottom bar... How should I solve this?
That doesn't happen on 3.5 inch screen.
UPDATE:
Same problem happens on EGOPhotoViewer_Demo
This is how the screen looks on the first usage:
When getting into "Photos" and go back to that main screen it change to:
You can see something hides the bottom of the screen. On my app I have buttons there so it's problematic.
Hope this update makes my problem more clear.
I’m not sure but this might be a duplicate of iPhone 5 app displaying correctly but not sensing touches in “extra” space
Also, do you have the same problem on iOS 6? From the screenshots, it seems you are using iOS 7, which could be the source of your problem.
When compiling with Xcode 5 the problem is solved (test device was iOS 7).
I had the same issue.
The problem is the following statement in viewWillAppear:
[self.navigationController setToolbarHidden:NO animated:YES];
Move this statement and the accompanying "if" test to viewDidAppear and the problem goes away.
To be honest I am not sure why this ever worked - but it makes sense that showing the toolbar when our photo view is not yet up would show the toolbar in the parent view, not the photo view. Moving it to viewDidAppear does the right thing.