subinspathilettu / SJSegmentedViewController

MIT License
334 stars 126 forks source link

Can NOT scroll to bottom when set headerViewHeight = 316.4 in iPhone 8 Plus #119

Open TrungTuyenTran opened 5 years ago

TrungTuyenTran commented 5 years ago

In iPhone 8 Plus , when I set headerViewHeight = 316.3, Go to Segment Tab -> Fourth Tab, the collectionView can scroll to bottom. But when I set headerViewHeight = 316.4 , it can NOT scroll . And If I set it to 316.5 , the collectionView can scroll to bottom. I don't know why ???

zungx commented 5 years ago

same issues

kidvicious commented 5 years ago

have you tried setting the content inset for the view?

alexanderathan commented 5 years ago

Dear @TrungTuyenTran,

I think that I have found a solution to this problem. At least in my case, if I round the height before I set it, it can actually scroll normally.

Do something like this:

let customHeaderHeight = 316.3
headerViewHeight = round(customHeaderHeight)

Please let me know if this did work for you!

Best regards, Alexandros Athanasiadis

zungx commented 5 years ago

Dear @TrungTuyenTran,

I think that I have found a solution to this problem. At least in my case, if I round the height before I set it, it can actually scroll normally.

Do something like this:

let customHeaderHeight = 316.3
headerViewHeight = round(customHeaderHeight)

Please let me know if this did work for you!

Best regards, Alexandros Athanasiadis

Thank for reply, I try to rounded, it work well on iPhone8Plus, but sometime cannot work on iPhone XS Max or maybe other latest model