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
}
Related
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 .
in iOS 7 the MWPhotoBrowser is using weird coordinates for the first displayed image. I looked into the code but I don't get it.
In iOS 6 it is only possible to drag/swipe the images in the browser horizontally, but in iOS 7 its movable into any direction.
Maybe someone has an idea on this.
#see: https://github.com/mwaterfall/MWPhotoBrowser/issues/126
As commented on https://github.com/mwaterfall/MWPhotoBrowser/issues/126#issuecomment-24834650
you need to add
if ([self respondsToSelector:#selector(automaticallyAdjustsScrollViewInsets)]){
self.automaticallyAdjustsScrollViewInsets = NO;
}
to the viewDidLoad of the MWPhotoBrowser.
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.
Today i am going to create an iphone application which is compatible with iphone4 and iphone5. Earlier i have changed iphone4 application views programetically by using below code to adjust controllers for iphone5.
CGRect screenBounds = [[UIScreen mainScreen] bounds];
if (screenBounds.size.height == 568) {
// code for iphone5
}
else {
// code for iphone4
}
am thinking this is difficult to track all the frames and sizes of controllers each and every time. I have created one sample app and also tried with Auto-resizing option(i have put check mark) at the starting of view and selected size Retina 4 full screen in inspector. And also selected simulator hardware-device is iphone Retina-4 inch
if i change simulator hardware-device is iphone Retina-3.5 inch then the screen is looking like
My question is without setting frames how can i achieve this problem.
Please help me.
Thanks in advance.
You can use this link for autosizing
http://blog.mugunthkumar.com/coding/supporting-the-iphone-5/
Instead of giving static numbers give frames dynamically. means instead of giving 320 give self.view.frame.size.width so you no need to check the device, just you need to add default splash screen.
You problem could be resolved easily using Autolayout feature provided in the XCode Version 4.x .
Go through the following link :-
http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2
By applying few contraints using Autolayout your problem could easily be resolved.
Happy Coding :)
Since i want the app to run in both ios 5 as well as in ios 6 ,I am trying to run the app in ios 5 which is working perfectly in ios 6 as i have used the autolayout feature but when i use to run the app in ios 5 it crashes since autolayout feature is not available in previous versions of ios .Is there any solution to fix out my problem ?
Answer will be appreciated.
If you want to run your app in iOS 5 then you have to turn off the Autolayout feature.
You can do that from Interface builder.
For more help you can refer this.
You Need to unCheck the Auto Layout.
And make sure you are changing here also.. select ios 5.1
You have to use AutoResizing mask for your view instead of autolayouts since autolayouts are supported iOS 6 onwards.Check the example below
If you are using iOS 6 or later , then u can create a separate xib for the iphone 5 called Retina 4 Full screen. You need to check this in your ViewController Size. Also to check for for both of these xib's . That means to run either of your xib's in iphone 5 or lower versions use these conditions whether in the AppDelegate or wherever you need to show another ViewController.
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
}
else if(result.height == 568)
{
}
the above code would check for the size of your iphone's screen and accordingly adjust.
Hope this has cleared your issues :).
PS:- Dont forget to add your iphone 5 splash screen i.e Default-568h#2x.png.