简体   繁体   中英

UITextField not showing up on View Controller

I've added a simple UITextView and i placed it where i want to in the storyboard, then i click on add missing contraints/reset to suggested and it doesn't show up on the screen when i run it, i don't know why its not working

this is what i get in the debugger.

Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) ( "<_UILayoutSupportConstraint:0x15ed61540 V:[_UILayoutGuide:0x15eee5f50(20)]>", "<_UILayoutSupportConstraint:0x15ed0c500 V:|-(0)-[_UILayoutGuide:0x15eee5f50] (Names: '|':UIView:0x15eee5df0 )>", "", "", "" )

Will attempt to recover by breaking constraint

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in may also be helpful.

Using the "add suggested constraint" is usually not a good idea. I really recommend that you study more about auto-layout and adaptive layout. I'd need to know exactly how you want to position and size you UITextField to determine what is the conflicting constraint for your case, it would be important to know what other views you have in your view controller that might be affecting the text field.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM