ios - TableView scrolls beyond the last cell -


i have 2 tableviews in viewcontroller , setup constraints both of them. have setup constraints , alignments. problem that, when starts, alignments work expected, when push tableview1 above (to come bottom), pushes last cell more (please check screenshots below).

here video showing problem

and behaviour of horizontal inspector

last update: thought of workaround couldn't figure out how apply it. if can y position of last row inside tableview, maybe can force tableview not scroll below 'y position + row height'. there way can that?


original question:

it's working fine when starts , seems expected last row/cell's bottom attached bottom of tableview

enter image description here

(red tableview1 , pink tableview2)

but when scrolled , reached bottom, scrolls more bottom cell. instead bottom cell should attached bottom of tableview1.

(blue tableview1's background color)

enter image description here

what may problem? how can make bottom tableviewcell of tableview1 attach bottom of tableview1, doesn't scrolled more?

update: made tableview1's height 132 , each row 44. it's creating gap same size of 44. checked numberofrowsinsection, , count expected, not +1.

why can happened?


update2: pretty sure it's not code, here code

tableview1 constraints:

enter image description here

let sampledata = [     previewdetail(title: "small"),     previewdetail(title: "medium"),     previewdetail(title: "large"),     previewdetail(title: "large")   func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell {      var cell:uitableviewcell?      if tableview == self.tableview1 {         cell = tableview.dequeuereusablecellwithidentifier("tv1cell", forindexpath: indexpath)         let previewdetail = sampledata[indexpath.row]         cell!.textlabel!.text = previewdetail.title     }     return cell! }   func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int {     var count:int?      if tableview == self.tableview1 {         count = sampledata.count     }     return count! } 

finally i've found answer. weirdly, when have 'deck of views' as..

tabbarcontroller -> navbarcontroller -> viewcontroller -> view -> 2xtableviews 

..it causing buggy view. tried recreating issue in dummy project understand nature of problem, , causing same issue on dummy project too.

the answer:

the answer un-ticking adjust scroll view insets in viewcontroller. works fine.


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

python 3.x - PyQt5 - Signal : pyqtSignal no method connect -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)