UIWebView becomes too big when using iOS 6/7 Deltas - ios

I have a UIWebView in my app. Due to the differences between iOS 6 and iOS 7, it has be a slightly different size. I'm trying to achieve this with iOS 6/7 deltas in IB. It seems like this should be easy, but it's not working right. On iOS 6, the UIWebView needs to have a height of 373 and on iOS 7 it needs to have a height of 393. However, when I set the height in iOS 6/7 deltas, it's fine on iOS 7 but when it's run on iOS 6 the UIWebView's height increases to 745. That is way too big. I've also had this problem the other way around (where it's fine on iOS 6 but way to big on iOS 7). I can't figure out why this is happening. Does it have something to do with the way iOS 6/7 deltas work? Is there another solution?
Here are my deltas:
With "View as iOS 6.1 and Earlier" enabled:
With "View as iOS 7.0 and Later" enabled:
Also something I should have mentioned before is I'm not using Autolayout as I want to maintain compatibility with iOS 4.3.

You are misunderstanding how deltas work.
"Delta" means the "difference", as you have used when setting the y value.
If the views have the same height, simply set the delta of the height to 0. If the height is different, set the delta to the difference.

Related

Why autolayout behaves different in iOS 7 and iOS 8?

For example: I have set in a storyboard scene a vertical space constraint from de bottom of a UIButton to the bottom of the superview with a constant of 20. When running in an iOS 8 device, this is correctly shown, but when running in an iOS 7 device, it looks like this constant becomes higher and the button is shown upper in the screen... I don't understand why this happens, since autolayout is supposed to be available since iOS 7.
Any help? I don`t know how to handle this.
Thanks in advance
One of new things in iOS 8 is the Layout Margin. Layout Margin is a new property available in UIView for iOS 8. So, any objects inherit from UIView will have this property. If you are developing the app for both iOS 7 and iOS 8, you should not use Layout Margin (or use layout margin in a smart way).
So, if you have any constraints related to layout margin and you didn’t do a proper check before launching the app on iOS 7 devices, the app might crash or the arrangement of the objects might be out of order.
Whenever you are trying to add new constraints from the storyboard in XCode 6, “Constrain to Margins” is ticked by default. The meaning of this selection is to add constraints with the new property in iOS 8.
If the deployment target of your app is iOS 7 and above and any of your constraints have this layout margin, the XCode will complain with the warning “Layout attributes relative to the layout margin on iOS prior to 8.0″.
If you are developing the app for both iOS 7 and 8, it is best to “Untick” the Constrain to Margins.
Reference: you should also check this great tutorial

Size classes not support UI elements for regular width and regular height in IOS

I developing an iPad application to support landscape only. I have chosen the size classes with Regular Width and Regular Height size. Whenever placing UIView or UI elements and run in the device, It works fine in the IOS 8 but it wont display in the IOS 7. seems looks like size class compatabile issue. Can anyone share your thoughts about how to resolve these UIview to display even in the IOS 7.
Thanks In Advance!!
iOS 7 Does not support size classes. I had this issue and I resolved it by forcing iOS 8 compatibility.
Unfortunately I think your best bet (which is kind of terrible) would be to branch your code and make two separate storyboards one for iOS7 and one for iOS8. That being said, given you are only supporting iPad min and iPad normal, you could do two separate storyboards depending on which device it is.
I know neither of these 3 options is ideal but thus is the cost of backwards compatibility.
Summary:
punt on iOS7
develop an iOS7 specific version and an iOS8 version
develop a separate storyboard for iPad mini and iPad Normal

iPhone 6 Plus support fonts issue

I'm starting on adding iPhone 6 support for my app.
I don't want to use Size Classes since the app runs on iOS7 as well.
I'm planning on using auto-layout for views positioning but I'm not sure how to handle font sizes.
I want to make some of the fonts bigger on iPhone 6 plus.
How can I do that using Auto-Layout without Size Classes?
You can use size classes and support iOS7, it's an Xcode related feature to help you design the behaviour of your app.
Get the latest version of Xcode, set the deployment target to iOS7 and start designing your ViewController's using size class.

Interface Builder, frame changes on IOS 6

I have a xib file that support IOS 6 and 7.
The problem is when i selected view as IOS 6 the frame from IOS 7 change, and vice versa.
Here is a screenshot, previewing the IOS 6.1.
I adjust the frame to (0, -3, 255, 85) and when adjust the frame using view as IOS 7 the frame becomes:
(-345,894,0,0).
When i adjust the frame using view as IOS 6.1 and early the frame changes for IOS 7.
I just want to use the same frame in both IOS version.
Some informations that may be relevant:
Was an existing project build for IOS 5.1 and later, then i update the project to support IOS 7.
When i made the update some views (include this one) have their frame changed to positions that does not make any sense and size their size set (0,0).
First i think was an interface builder issue preview issue, but i tested on devices with IOS 6 and 7 and the results are the same from the preview
Thanks in advanced!
When you assign bottom margin & top margin in Autoresizing tab, iOS 7 gets confused & produces strange effects.
I faced the same problem, & i solved it using height stretch. Refer image.
Use 'iOS 6/7 deltas' fields to adjust design element(s) position on your controller for different iOS.
You should setup your project (setup how UI view) for one of iOS versions (6.1 or earlier/7.0 or later) and then adjust interface by deltas to other version.
You also can use new preview mode to see difference between two operation systems on one screen.
Here is link to APPLE iOS 7 transition guide - https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TransitionGuide/SupportingEarlieriOS.html#//apple_ref/doc/uid/TP40013174-CH14-SW1
First set your view size as none and then Set your frame using view as iOS 6.1 and earlier. Now test in iOS 6 and 7. It will automatically resize your view frame.

Default UIProgressView rendering on iOS7 using iOS6 SDK

I am experience a rendering bug when using the default progress view. Rather than being 9px tall, the view is clipped to about 4px when using the default progress view. My app is built with the iOS6 SDK, and the issue appear when running on a iOS7 device. The interface is built with interface builder.
Is there a simple fix for this issue? Switching the style from "Default" to "Bar" in interface builder fixes the problem, but that changes the appearance.
Setting the frame in code helped me solve this.
#iPP 's answer is not the best. Setting the frame in code will cause your code to be riddled with iOS version checks, and that code tends to get very complicated when supporting multiple device orientations.
I think the best way is to use new feature "iOS 6/7 Deltas" in Xcode 5.
And "iOS 6/7 Deltas" key usage is:
When Auto Layout is turned off, you will notice an area in the sizing tab of the utility area (right pane) of Interface Builder that allows you to set iOS 6/7 Deltas. Deltas can be set individually for each view and work as you would expect. If your storyboard or nib is set to view as iOS 6, then setting the deltas will cause that view to be shifted and/or resized by the set delta amount when run in iOS 7. Alternately, if your storyboard or nib is set to view in iOS 7, then the deltas will be applied when run in iOS 6. Both of these tools help you to support older versions of iOS alongside iOS 7
for UIProgressView, here you can try to set "delta Y" to be -7px, because iOS 7 just reduce the Y origin of UIProgressView by 7 px, so when running in iOS7, we should give it back the 7px.
It's like the iOS7 cut the progress view use the iOS7 Style's frame.
You have two ways.
1. set the progress view style ---bar, you can do this in the nib file or code.
2. use the code to set the frame. Something like:
progressView.frame = CGRectMake(x,y,w,h);
The second will face the layout issue when you rotate or change the layout.
So the easiest way is set the progress view's style.

Resources