Nitish Lamba
Nitish Lamba

Reputation: 157

How to bring the selected thing in middle in scrollview?

I am developing an application in which what i want is when i select something from scroll

view, the selected thing comes in the middle of the scroll view and one more thing which i

did not mention in question that if i am scrolling the scroll view,how can i fade the

contents which are not in the middle and again get them back in original color when they are

in middle.

Thanks,

Upvotes: 0

Views: 232

Answers (1)

Alexander
Alexander

Reputation: 8147

Here are possible solutions to your questions:

  • to center, once you get the touch on an object, select it and move scroll view's contentOffset according to the selected item's position
  • to fade the items, either implement the scrollViewDidScroll: from the UIScrollViewDelegate protocol and watch every item that is off-center, or place semi-transparent (with gradient) images over the edges of the scroll view

Upvotes: 1

Related Questions