Height of UITableView changed after scroll the view

Hazem

I use UIScrollView with two tableviews. One of them is dynamic height changed because I insert cells in runtime and the second table is fixed height.
When the application runs and adds cells to the first table everthing is normal and it changed the height of the table and the height of the contentsize of scrollview.

The problem is: when I scroll and scrollViewDidScroll was called the height of first tableview returns to its initial height and cells were added get nil, the second table view didn't create a problem because its height is fixed.

Note: I used constraints and removed them (the problem remained).

What's the wrong? I use iOS 8 and xCode 6.1.

Thank you for your help!

Hazem

The problem was solved by add constraints on UITableView

[self addConstraint:[NSLayoutConstraint constraintWithItem:yourButton
                                           attribute:NSLayoutAttributeHeight
                                           relatedBy:NSLayoutRelationEqual
                                              toItem:nil
                                           attribute:NSLayoutAttributeNotAnAttribute
                                          multiplier:1.0
                                            constant:30.0]];

because I use auto-layout I hope this answer help anyone

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Android View width and height have not changed after rotation

From Dev

Android View width and height have not changed after rotation

From Dev

UIStackView not updating after updating height of subview (UITableView with no scroll) while inside a ScrollView

From Dev

UITableView Scroll automatically to the top after begin/end updates call for adjust height

From Dev

Increase Scroll view height in middle

From Dev

Increase Scroll view height in middle

From Dev

Objective-C UIWebview and UITableView scroll height

From Dev

view changed unexpectedly when scroll list

From Dev

Container view does not check UITableView data in scroll?

From Dev

ios, UITableView, indent changed unexpectedly after scrolling

From Dev

Unnatural jerk with UITableView whe cell height is changed dynamically

From Dev

UITableView in UIScrollView not responding to first tap after scroll

From Dev

iOS UITableView resize height / cant scroll down issue

From Dev

Bottom-up UITableView with different item height scroll to end

From Dev

ios UITableView after CGAffineTransformMakeScale, how to reset UITableView's height

From Dev

Scroll view and Content view height mismatching at run time

From Dev

images get shuffled or changed when i scroll in list view

From Dev

ListView -images get shuffled or changed when i scroll in list view

From Dev

How to update the view after the model has changed?

From Dev

Trigger a view to render after model changed

From Dev

GridView is not refreshing view after data changed

From Dev

How to update the view after the model has changed?

From Dev

Angular render view after parameter changed in service

From Dev

Cells in UITableView going blank after the view loads

From Dev

Custom View with dynamic Height as UITableView Header ios xcode

From Dev

UITableView: Set table header view height based on screen size

From Dev

Tapping on section(Height 400.0f) View of UITableview calls didSelectRowAtIndexPath

From Dev

Scroll to top after route has changed (nested divs)

From Dev

Collection View Cells alpha is changing after scroll

Related Related

  1. 1

    Android View width and height have not changed after rotation

  2. 2

    Android View width and height have not changed after rotation

  3. 3

    UIStackView not updating after updating height of subview (UITableView with no scroll) while inside a ScrollView

  4. 4

    UITableView Scroll automatically to the top after begin/end updates call for adjust height

  5. 5

    Increase Scroll view height in middle

  6. 6

    Increase Scroll view height in middle

  7. 7

    Objective-C UIWebview and UITableView scroll height

  8. 8

    view changed unexpectedly when scroll list

  9. 9

    Container view does not check UITableView data in scroll?

  10. 10

    ios, UITableView, indent changed unexpectedly after scrolling

  11. 11

    Unnatural jerk with UITableView whe cell height is changed dynamically

  12. 12

    UITableView in UIScrollView not responding to first tap after scroll

  13. 13

    iOS UITableView resize height / cant scroll down issue

  14. 14

    Bottom-up UITableView with different item height scroll to end

  15. 15

    ios UITableView after CGAffineTransformMakeScale, how to reset UITableView's height

  16. 16

    Scroll view and Content view height mismatching at run time

  17. 17

    images get shuffled or changed when i scroll in list view

  18. 18

    ListView -images get shuffled or changed when i scroll in list view

  19. 19

    How to update the view after the model has changed?

  20. 20

    Trigger a view to render after model changed

  21. 21

    GridView is not refreshing view after data changed

  22. 22

    How to update the view after the model has changed?

  23. 23

    Angular render view after parameter changed in service

  24. 24

    Cells in UITableView going blank after the view loads

  25. 25

    Custom View with dynamic Height as UITableView Header ios xcode

  26. 26

    UITableView: Set table header view height based on screen size

  27. 27

    Tapping on section(Height 400.0f) View of UITableview calls didSelectRowAtIndexPath

  28. 28

    Scroll to top after route has changed (nested divs)

  29. 29

    Collection View Cells alpha is changing after scroll

HotTag

Archive