ios - Non-floating UITableView footer -


i have uitableview bunch of custom cells (and each cell has custom height , dynamic height).

i want add footer view tableview on bottom of tableview contentsize.

if contentsize bigger screen size in bottom of tableview (you scroll down, regular last cell).

if contentsize smaller screen size footer still in bottom of screen , there gap last cell footer.

i've tried add footer this:

func tableview(_ tableview: uitableview, viewforfooterinsection section: int) -> uiview? {     let myfooterview = bundle.main.loadnibnamed("myfooterview", owner: self, options: nil)?.first as! myfooterview     myfooterview.delegate = self     myfooterview.frame = cgrect(x: 0, y: 0, width: self.tableview.frame.size.width, height: 100)     return myfooterview } 

but footer floating in on bottom when scroll. tha'ts not want achieve.

any idea how can achieve non-floating footer want?

thanks! :)

add view subview table view , adjust position in scrollview:didscroll:. able this, add conformance uiscrollviewdelegate view controller. think uitabelviewcontroller automatically delegate table view (which uiscrollview).

the tricky part calculation of position based on content size, content offset, size of view , size of footer.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -