Adding a UITableView as a Subtask of a UITableViewCell Using AutoLayout

I actually have a problem with auto-layout. How can I fix the problem? I do not understand what it is and how to fix it.

Description

I am trying to solve a few problems:

  • The presence of UITableView # 1 with two subclasses of UITableViewCell: HeaderCell and ListSongsCell.
  • The presence of UITableView # 1 with dynamic cell height.
  • The presence of UITableView # 2 as a subtask of ListSongsCell.
  • The presence of UITableView # 2 with dynamic height (depending on the number of rows). The cell type for UITableView # 2 is the base (44px height).

I am mainly trying to create a tableview view here.

Here is an image of what I expect:

http://imageshack.us/a/img703/9374/i7wn.png

UITableView # 1 HeaderCell. HeaderCell , UIImageView.

ListSongsCell UITableView # 1, :

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) 
(
    "<_UIScrollViewAutomaticContentSizeConstraint:0x8a8e820 UITableView:0x9275c00.contentHeight{id: 199} == -150.000000>"
)

Will attempt to recover by breaking constraint 
<_UIScrollViewAutomaticContentSizeConstraint:0x8a8e820 UITableView:0x9275c00.contentHeight{id: 199} == -150.000000>

Break on objc_exception_throw to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

, - , , . , :

  • ListSongsCell
  • ContentView ListSongsCell
  • UITableView # 2

? , ? , ?

?

, , :

  • ,
  • , .
  • ( ).

, , .

, , .

  • UITableView
  • iosstuff.wordpress.com/2011/06/29/adding-a-uitableview-inside-a-uitableviewcell/

GitHub, : https://github.com/hefgi/TableViewInTableViewCell

, ( GitHub/ ).

+4

All Articles