Вопрос

I'm trying to have custom constraints for objects in my storyboard but I get a bunch of warnings that say

Misplaced View Frame for "Some object" will be different at run time.

or

Ambiguous Layout: Width and horizontal position are ambiguous for "Some object"

The problems is that if I let Xcode resolve them it will mess up the custom constraints I've set up. The recommended constrains make the layout look bizarre. So how can I suppress these warnings because I'm trying to do something very customized?

Это было полезно?

Решение

Ok guys I've solved the problem. I was pretty new to autolayout so it was very frustrating trying to learn it by trial and error.

I solved it by reading this awesome autolayout Xcode 5 tutorial and adding the necessary constraints.

If anyone else is having problems with constraints I can't reccomend the tutorial enough.

Другие советы

If you'd like to disable storyboard warnings altogether, go to your project build settings and set "Interface Builder Storyboard Compiler - Options" -> "Show Warnings" to "No."

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top