开发者

UIScrollView in "U" shaped

开发者 https://www.devze.com 2023-02-02 00:38 出处:网络
I want to know whether it is possible to create a scrollview that has a \"U\" shape or 开发者_开发技巧consisting of any other curvy patterns??

I want to know whether it is possible to create a scrollview that has a "U" shape or 开发者_开发技巧consisting of any other curvy patterns??

Any ideas??


You can write a Custom Gesture Recognizer to recognize a "U".

It involves implementing the following methods:

- (void)reset;
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;

and doing the geometry to find the pattern you are looking for.


For rendering, probably some kind of transform layer could help. For touch processing, however, you probably are on your own.

0

精彩评论

暂无评论...
验证码 换一张
取 消