I have an app I was building for iOS 6 that I recently upgraded to iOS 7. I have a UIScrollView with a Custom UIView. Inside that, I have 4 custom UIViews. For some reason, these views show up fine on iOS 6, but iOS 7 they will not show them. I've tried: self.edgesForExtendedLayout = UIRectEdgeNone;
As I said, it shows up fine in iOS 6. What could I be doing wrong?
Related
I copied iOS 7 sdk to xcode 4.6 sdks directory. Now I can set Base SDK to either iOS 6 or iOS 7. I can successfully run iOS 6 apps on
I am running an iOS 6 app on iOS 7 device using Xcode 4.6. Base SDK is set to 6.1.
Her is some code from AppDelegate:
navigationController = [[UINavigationController alloc] initWithRootViewController:mainViewController];
navigationController.navigationBarHidden = YES;
window.rootViewController = navigationController;
Now I have a strange problem on iOS 7 device that status bar doesn't show anything and its transparent.
Previously I installed another app on iOS 7 device with Base SDK set as 6.1, It was working perfectly but in that application NavigationBar wasn't hidden.
What I get when I run the app(the one whose code is above) it shows as this:
and
I have tried everything to make status bar solid but its not working. Navigation bar shown in these images is an image view and default navigation bar is hidden. I wonder how its working in another app of mine in which navigation bar is not hidden.
Please Help
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.
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.
How can I enable "AutoLayout" programmatically. Actually I have to create an app which should run on iOS6 and iOS5 but we can enable "AutoLayout" in the XIB in iOS 6 only and it will not work on the iOS 5 so I am checking the iOS version and using if else condition for the appropriate task according to the iOS. So if app would be running on iOS 6, I will enable the AutoLayout otherwise I will write the code for AutoResizing. Please let me know if I am unclear at any point.
If you want autolayout on iOS6 devices but not iOS5 (unuspported) but still want to use nib's, you have to keep separate nibs. One for iOS5 and one for iOS6.
When loading your nib, check if autolayout is supported by checking if the NSLayoutConstraint class exists:
if (NSClassFromString(#"NSLayoutConstraint"))
//Load iOS6 nib with autlayout.
else
//Load iOS5 nib sans autolayout.