UITableView to fit its dynamic content?

user2083364

I have a table and I want to prevent its scrolling and resize it to fit its content instead.

There a lot of similar questions-answers but they are all about static tables.

My table has sections for rows with section headers. I hide or show section cells on click on this section's header.

CGRect frame = detailsTableView.frame;
frame.size.height = detailsTableView.contentSize.height;
detailsTableView.frame = frame;

As I understand it is code I need. But how and where to call it?

user2083364

My current solution is to set tableView frame in a click section view event.

I calculate a total table view height as a sum of its item heights and it has some troubles with animation. But as for the rest it works.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to resize UITableView width to fit its content?

From Dev

How to fit label according to its content in UItableView

From Dev

JTextPane - fit size to its content

From Dev

fit width of <td> to its content

From Dev

Scale div with its content to fit window

From Dev

Fit UIView height to its content with AutoLayout

From Dev

How to resize UITableViewCell to fit its content?

From Dev

How to fit DataGridView width and height to its content?

From Dev

Resizing UIScrollView to fit its content… not working

From Dev

HTML <object> fit height of its content

From Dev

JavaScript table to shrink to fit its content

From Dev

card-content on materialize not fit in its class

From Dev

A TableView that "fits" (ala "sizeToFit") its dynamic cell's content size. Then nested in a parent UIView that is also "sized to fit"

From Dev

Setting dynamic height on UItextview to fit content programmatically

From Dev

UITableView with dynamic prototypes content and multi sections

From Dev

How to resize UITableView with a large list to fit all the content without scrolling?

From Dev

How to resize UITableView with a large list to fit all the content without scrolling?

From Dev

How to resize a Win32 listbox to fit its content?

From Dev

How to make NSTableView column fit its content on resize?

From Dev

How to make a readonly <s:textarea /> fit to its content

From Dev

iframe auto adjusting its height to fit to the content height

From Dev

Sizing DataGrid to fit to its content when space available in WPF

From Dev

How to make a readonly <s:textarea /> fit to its content

From Dev

UITableView dynamic content size height inside UIScrollView with AutoLayout

From Dev

Make child div fit its content while its parent has scrollbars?

From Dev

Is it possible to make an UILabel, UITextView, or similar that always resizes its height to fit its content in Interface Builder without truncating?

From Dev

Make every <td> width fit its content instead of the <td> with the longest content in the same column

From Dev

Fit Text in UItableView Cell

From Dev

Auto Fit Height of UITableView

Related Related

  1. 1

    How to resize UITableView width to fit its content?

  2. 2

    How to fit label according to its content in UItableView

  3. 3

    JTextPane - fit size to its content

  4. 4

    fit width of <td> to its content

  5. 5

    Scale div with its content to fit window

  6. 6

    Fit UIView height to its content with AutoLayout

  7. 7

    How to resize UITableViewCell to fit its content?

  8. 8

    How to fit DataGridView width and height to its content?

  9. 9

    Resizing UIScrollView to fit its content… not working

  10. 10

    HTML <object> fit height of its content

  11. 11

    JavaScript table to shrink to fit its content

  12. 12

    card-content on materialize not fit in its class

  13. 13

    A TableView that "fits" (ala "sizeToFit") its dynamic cell's content size. Then nested in a parent UIView that is also "sized to fit"

  14. 14

    Setting dynamic height on UItextview to fit content programmatically

  15. 15

    UITableView with dynamic prototypes content and multi sections

  16. 16

    How to resize UITableView with a large list to fit all the content without scrolling?

  17. 17

    How to resize UITableView with a large list to fit all the content without scrolling?

  18. 18

    How to resize a Win32 listbox to fit its content?

  19. 19

    How to make NSTableView column fit its content on resize?

  20. 20

    How to make a readonly <s:textarea /> fit to its content

  21. 21

    iframe auto adjusting its height to fit to the content height

  22. 22

    Sizing DataGrid to fit to its content when space available in WPF

  23. 23

    How to make a readonly <s:textarea /> fit to its content

  24. 24

    UITableView dynamic content size height inside UIScrollView with AutoLayout

  25. 25

    Make child div fit its content while its parent has scrollbars?

  26. 26

    Is it possible to make an UILabel, UITextView, or similar that always resizes its height to fit its content in Interface Builder without truncating?

  27. 27

    Make every <td> width fit its content instead of the <td> with the longest content in the same column

  28. 28

    Fit Text in UItableView Cell

  29. 29

    Auto Fit Height of UITableView

HotTag

Archive