coolbeet / CBStoreHouseRefreshControl

Fully customizable pull-to-refresh control inspired by Storehouse iOS app
MIT License
3.92k stars 480 forks source link

Fix a bug when scrollview has content inset top 0 #7

Open mplulu opened 10 years ago

mplulu commented 10 years ago

Using the refresh control with scrollview with content inset top 0 (can cause by self.edgesForExtendedLayout = UIRectEdgeNone;) will cause original content inset to be set as the content inset after the refresh control has started animating -> it will not go back to content inset 0. You can test it easily by comment out the line to set self.edgesForExtendedLayout in the sample project. To fix it, only set self.originalTopContentInset when state is still Idle (no pull refresh has occurred)