मैं UITabbar
के परिवर्तन स्थिति मैन्युअल SWRevealViewController
प्रतिनिधि विधि का उपयोग कर समस्या का समाधान। इस कोड को MenuViewController
पर रखें।
MenuViewController.m
- (void) viewDidLoad {
[super viewDidLoad];
UITabBarController *tbc = (UITabBarController *)[[[[UIApplication sharedApplication]delegate]window]rootViewController];
self.tabBar = tbc.tabBar;
_tabBar.frame = CGRectMake(self.revealViewController.rearViewRevealWidth, _tabBar.frame.origin.y, _tabBar.frame.size.width, _tabBar.frame.size.height);
self.revealViewController.delegate = self;
}
- (void) revealController:(SWRevealViewController *)revealController willMoveToPosition:(FrontViewPosition)position {
if (position == FrontViewPositionRight) {
_tabBar.frame = CGRectMake(self.revealViewController.rearViewRevealWidth, _tabBar.frame.origin.y, _tabBar.frame.size.width, _tabBar.frame.size.height);
}
else {
_tabBar.frame = CGRectMake(0, _tabBar.frame.origin.y, _tabBar.frame.size.width, _tabBar.frame.size.height);
}
}
- (void)revealController:(SWRevealViewController *)revealController panGestureMovedToLocation:(CGFloat)location progress:(CGFloat)progress overProgress:(CGFloat)overProgress {
_tabBar.frame = CGRectMake(self.revealViewController.rearViewRevealWidth * progress, _tabBar.frame.origin.y, _tabBar.frame.size.width, _tabBar.frame.size.height);
}
स्रोत
2016-01-21 04:50:47
आपको अपने एप्लिकेशन में UIContainerViewController उपयोग कर सकते हैं। Https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/ImplementingaContainerViewController.html और एक उदाहरण http://www.thinkandbuild.it/working-with-custom-container-view- पर अधिक जानकारी मिल सकती है। नियंत्रक/ –
@Gagan_iOS मैं समझ नहीं पा रहा हूं कि कैसे उपयोग करें। कृपया विस्तार से बताएं। –
ठीक है, आप UITabBarController का उपयोग कर रहे हैं और प्रत्येक टैब में UIViewController होगा। इसलिए आपको किसी विशेष टैब के UIViewController पर UIContainerView जोड़ना होगा। जैसा चाहें जोड़ने के लिए यहां एक उदाहरण दिया गया है। http://mobileoop.com/how-to-use-container-view-controller आपको बस अपने कोड के UIViewController पर इस कोडिंग को लागू करना होगा। –