iPhone Tabbar Controller with UIPageController
I have an iPhone tabbar application with "开发者_开发技巧n" number tabs. I'd like to have a UIpagecontrol in place so I could swipe between tabs. Could anyone tell me how I could do this? Examples are very helpful.
Much appreciated.
You should double check if UIPageController is the correct way to do this with the iPhone UI Guidelines. I think that is more for having several pages in one tab instead of switching between the tabs and that they are not usually used together. Would seem a bit weird to have those white dots appearing :)
If you still want to flick between the views instead of using the buttons in the tab bar you could just quite easily listen for the touch swipe events and change view when you detect one. You can do this by implementing these methods:
(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
See the iPhone Cocoa Fundamentals Guide for how to detect drag and swipe gestures.
精彩评论