1. The previous application required this effect but was then implemented using a more complex (drawing) approach, and a new approach was now in mind.
2. Use of the http://www.cnblogs.com/yoon/p/3616503.html inside the tips
3. Ideas:
Mainly in the new ScrollView rewrite layoutsubviews
The code is as follows:
-(void ) layoutsubviews{[ Super Layoutsubviews]; for (UIView *view in Self.subviews) { if (View.tag = = 2014 ) {CGRect re CT = View.frame; rect.origin.x =-self.superview.frame.size.width + Self.superview.frame.size.width/4 /2
+ self.contentoffset.x/4 +self.contentoffset.x; View.frame = rect; } }}
Explanation, to ensure that the X coordinate is reasonable, and based on a few pages or a few screens to ensure a scrolling distance, so is self.contentoffset.x/4(scrolling distance, the current number of pages)
:
Full code:
Http://pan.baidu.com/s/1jGE98QM
PS: Material from Xiaomi Mall