Question I am using Apple's PageControl sample code for horizontal scrolling in portrait layout and everything works fine except when the UIScrollView is first loaded, the initial page shown has either 1 The first page offset by 11 pixels at location 11,0 or 2 The second page offset by 19 pixels at location ,0 or 3 The second page offset by 65 pixels at location ,0 or 4 The first page offset by 81 pixels at location 81,0 or B why scrollViewDidScroll would end on offsets that are not multiples of ?
For B 1: If it ends on offsets that are not multiples of , you might have forgotten or setting the wrong frames and content variables,you should do such as: myScrollView. For C That's not right, forget that. Get answers to millions of questions and give back by sharing your knowledge with others.
Sign up for an account. The text was updated successfully, but these errors were encountered:. I noticed it as well. The scrollViewDidScroll method is called very frequently as the user changes the scrolling position of the scroll view. From Apple documentation of scrollViewDidScroll method. I guess this is how this delegate method is supposed to work so we can run some code as the user changes the scroll position of the scroll view. Sorry, something went wrong.
Skip to content. Star Yannick Loriot 5, 2 25 It didn't change anything — Gareth Miller Nov 11 at I didn't notice that your class was public , so you need to declare the delegate method as public too.
I've edited the post. Which swift version are you using? Because the API signature is without the! See developer. I was missing an! Sign up or log in StackExchange. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name.
Email Required, but never shown. Thanks for contributing an answer to Stack Overflow!
0コメント