Default UIProgressView rendering on iOS7 using iOS6 SDK - ios

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.

Related

UIViewController.view in UINavigationController size become 600x600 on iOS 9, and never changed

I am using Xcode 7 GM version to test my app for iOS9.
My app works find on iOS 8 & 7, while I am testing my app on iOS9 simulator, I find my view size is not correct. I setup my view controller in xib, using autolayout and size class. I only support portrait mode, so all of my constraints are only installed in w:compact, h:regular.
After debugging using Reveal, I found that, the self.view, a UIViewController of mine, embedded in UINavigationController, is always 600*600 size and never changed after autolayout.
I see there is constraint height:600, width:600 for self.view, but I never explicitly specify them. The point is why iOS 9 is behavining like this and how do I fix it? Thanks.
The self.view is like the root view and I got no chance to set autolayout for it. No idea why it is always and never changed.
Screen shot:
First, in portrait mode the size class of height is regular on any iPhone. Second, it's recommended to use size class Any as a starting point, then adjust them if you want different layout for a specific size class.

How to make an app for iOS 6 compatible which is built in iOS 7?

My application is in iOS7 compatible, Xcode 5. Now, I have to make it iOS 6 compatible, so when I set deployment target iOS 6.1, all frame changes, what is solution for this?
I have attached screenshot for reference.
One thing to notice, I have used storyboard and have not used autoLayout.
First of all of you should understand new iOS 7 UI. Check it here: link
There are few differences in UI that are connected to status bar new visualization and etc.
I have noticed that some elements have different y offset positions for iOS 6 and iOS 7.
So if you use storyboard or xib you can find
So if you can find iOS 6/7 Deltas option. I've attache screenshot for you:
Just modify delta Y position for all of view using -20 value because of status bar issue.
Hope it will help you.
Select each ViewController in your Storyboard and, tick both options "Under top bars" , "Under bottm bars"
Programmatically you'd set your view controller's wantsFullScreenLayout to YES. It defaults to NO under iOS 6 but both defaults to YES and is deprecated as of 7. Or set the "Use Full Screen (Deprecated)" tick box in the interface builder.
Look Size Inspector at 4th position in the utilities area at right side and change value of delta Y in IOS 6/7 to -20 and delta Height to 20. I hope it will work

How to make .xib files compatible to both iOS7, iOS6 and earlier [duplicate]

This question already has answers here:
Status bar and navigation bar issue in IOS7
(11 answers)
Closed 9 years ago.
I am using .xib files in my app and I am using xcode5.
If I run my app in iOS6 and earlier, the alignments are missing.
Any one know about this issue?
Do we have to create separate .xib files for iOS7 and iOS6?
EDIT: I turned off Autolayout but under iOS6, the views are still going down by 20 pixels.
If you haven't done so already, turn off AutoLayout in your xib files. Autolayout only came in with iOS 6 and newer iOS versions.
Also, you can preview what XIB files look like between iOS 6 and iOS 7 via a popup menu in the File Inspector:
in iOS7, the app windows starts from y=0px (in iOS6-, it begins at y=20px).
The quickest and easiest way to handle this, (and since you're already using Xcode5), is to switch off Autolayout and utilize the iOS6/7 Delta values for every view.
Basically:
Select every viewController's main view and uncheck "Use Autolayout"
Select every subView (UIButton, UILabel etc), go to the frame setting section
Increase their Y frame values by 20
but it seems you, #SudhakarTharigoppula, don't need to do this step.
...just do the next step
Enter a value of -20 for ΔY
This will start your app by leaving 20px in iOS7 but back in iOS6, the ΔY of -20px will compensate for the extra 20px you had given to every subView.
see: Status bar and navigation bar issue in IOS7

Status Bar Issue for Auto Layout in ios sdk due to missing Delta Property

My apps contains various xibs(Not Using StoryBoard), I am using Auto Layout to adjust view to support various devices.
The problem is on iOS6 my views leaving 20 pixel distance for status bar, since this has changed in iOS7. I searched on net and came across approach that by adjusting delta we can overcome this issue, but this will not work when we use Auto Layout, and I do not want to change it through code so is there way to handle this issue using interface builder also?
Thanks in advance!
I also searching for set the Edge Inset Uncheck but It is also not found in the Attribute Inspector Window as shown below.
Is there any way to add a Top Layout Guide in xib?
What can I do for solve this?
See these:
iOS 7 status bar back to iOS 6 default style in iPhone app?
iOS 7 - Status bar overlaps the view
https://stackoverflow.com/search?q=ios+7+status+bar

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.

Resources