IOS: changing UITableView height in auto layout

Is there a way to change the height of a UITableView programmatically if you use automatic layout? I have a view controller that should use Auto Layout. It also contains a UITableView, but the table view does not seem to answer setFrame calls.

+4
source share
2 answers

You can define your own restrictions programmatically. For more information on how to do this, see the Apple NSLayoutConstraint documentation.

+1
source

You definitely need to watch a WWDC 2012 video about Auto Layout on developer.apple.com. Videos:

  • Session 202 - Introduction to Auto-Layout for iOS and OS X
  • Session 228 - Best Practices for Mastering Car Dealerships
  • Session 232 - Example Auto-Layout

The videos show how to set limits in the code using the visual description language and in IB. They also cover some of the "gotchas" when switching to Auto-Layout.

+5
source

Source: https://habr.com/ru/post/1438961/


All Articles