UIStackView before iOS 9.0

后端 未结 4 1920
轮回少年
轮回少年 2021-01-31 15:21

I recently upgraded XCode to the latest Version 7.0 beta 3 (7A152u).

I am using Swift for building an iPhone app and when I try to use a Stack View in Main.storyboard I

相关标签:
4条回答
  • 2021-01-31 15:31

    The previous answers don't actually address the idea of removing the offending UIStackView, rather they change the deployment target to correct the issue. My solution doesn't force you to change deployment targets.

    I ran into this issue when I accidentally added a UIStackView (which is easy to do when adding layout constraints). To fix this issue, I went to the Document Outlet pane (shown below) and pulled my 'Round Style Text Field' out of the 'Stack View' hierarchy and into the 'View' hiearchy. Then you can delete the Stack View.

    This corrected the error for me, and I didn't have to change deployment targets. Hopefully this helps.

    0 讨论(0)
  • 2021-01-31 15:37

    Check inProject Targets-> Deployment info -> Deployment Target.If it's not 9.0 change it to 9.0.

    You need to change the deployment target of your application's target to iOS 9. Otherwise the app supports down to whatever OS that your deployment target is set to.

    Not solved?? Check out for other reason??? Check this:

    If your Deployment target is already set to 9.0 and you still get this error then try then check your project File inspector-> Project Document -> Project Format and check if its Xcode-6.3-compatible or not.If its not then set it to Xcode-6.3-compatible.

    The other reason is may be you accidentally add UIStackView and thats why you encounter the problem. UIStackView supports 9.0 and later and your deployment target doesn't allow that. So just check if you accidentally add UIStackView and if you added and you don't want it than just remove it.

    Note: setting the deployment target to 9.0 means that only devices running iOS9 will be able to run your app

    0 讨论(0)
  • 2021-01-31 15:43

    The accepted answer requires you to change your entire project deployment settings. If you don't want to require iOS 9 for your entire app, you can do this on an individual basis for a single xib or storyboard by setting the Builds for property in the file inspector pane of Xcode:

    Set this to iOS 9.0 or later and you will be able to continue to build your app for a lesser deployment target (7.0 in my case). Of course your app will crash if you attempt to load the xib on a device < iOS 9, so be sure to check this in code and take appropriate actions.

    0 讨论(0)
  • 2021-01-31 15:43

    In my case, my deployment target was already set to 9.0. I resolved this error by updating the project format from Xcode-3.2-compatible to Xcode-6.3-compatible.

    This can be found on the main Settings page of your Xcode project in the right column.

    0 讨论(0)
提交回复
热议问题