开发者

Use push and pop navigation behavior reusing same view(s)

开发者 https://www.devze.com 2023-02-04 08:44 出处:网络
I have list of frames. Each frame has context for view(e.g. text frame, image frame) and has specific view for type of frame(viewText, viewImage). Length of list could vary and could be huge. One view

I have list of frames. Each frame has context for view(e.g. text frame, image frame) and has specific view for type of frame(viewText, viewImage). Length of list could vary and could be huge. One view is visible at time. User uses gestures to go through frames.

Can I implement navigation 开发者_运维知识库logic(pop, push effects) which allows to reuse same view instances for different frames?


You can use UIGestureRecognizers to handle the gestures, and [UIView + (void)transitionFromView:(UIView *)fromView toView:(UIView *)toView duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options completion:(void (^)(BOOL finished))completion] to do he animation. To maintain the stack navigation, just use an NSArray, if you don’t want to mess with UIViewControllers.

0

精彩评论

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

关注公众号