iphone - Prevent automatic popToRootViewController on double-tap of UITabBarController -


एक UITabBarController का डिफ़ॉल्ट व्यवहार रूट निविष्ट करने के लिए निहित UINavigationController को पॉप करना है, जब किसी विशेष टैब को दूसरी बार टैप किया जाता है । मेरे पास एक विशेष उपयोग का मामला है, जहां मैं इसे स्वचालित रूप से काम न करने की इच्छा रखता हूं, और मुझे यह पता लगाना मुश्किल हो रहा है कि इसे कैसे रोकना है।

क्या किसी ने इस में भाग लिया है, और यदि ऐसा है, तो क्या क्या तुमने किया? क्या मुझे UINavigationController subclass और popToRootViewController ओवरराइड करने की आवश्यकता है या क्या कोई आसान तरीका है?

विधि का उपयोग करें ।

  - (BOOL) tabBarController: (UITabBarController *) टैबबीआरसी नियंत्रक चाहिए SELECTViewController: (UIViewController *) viewController {वापसी viewController! = TabBarController.selectedViewController; }  

इस प्रतिनिधि विधि को वास्तव में लागू करने वाले ऑब्जेक्ट के लिए टैब बार नियंत्रक का प्रतिनिधि सेट करना भूलना नहीं है।


Comments

Popular posts from this blog

iphone - How do I make a UIPickerView in a UIActionSheet -

java - Is there an object like a "Set" that can contain only unique string values, but also contain a count on the number of occurrences of the string value? -