iphone - view controller hide problem -


Hi, I have created a built-in window-based tabbar application. I made 5 tab bar item, tab is a client of time before the customer tapping me as a tab bar and 3 scene controller select list of such customers customer and this .For invoice list I block Need to add controller and 3-segment controller button is used.

I made a IBaction:

  - (IBAction) segmentedControlIndexChanged {switch (self.segmentedControl.selectedSegmentIndex) {case 0: CustomerListviewController * customerListViewController = [[CustomerListviewController alloc] Init]; [Self.view addubview: customerListViewController.view]; break; Case 1: SelectCustomerviewController * selectCustomerviewController = [[SelectCustomerviewController alloc] init]; [Self.view addubview: * selectCustomerviewControllerr.view]; break; Case 2: InvoiceListViewController * invoiceListViewController = [[InvoiceListViewController alloc] init]; [Self.view addubview: invoiceListViewController.view]; break; Default: Break; }}   

But when I tap a section controller, the background shows with the previous view how this problem can be resolved. If I have an alternative idea instead of using the Segment Controller, then I agree to use it. Plz helps anyone solve this or alternative solution.

Just to add a new you before deleting no idea, so they remove Sbwugh " RemoveFromSuperview "method, which you no longer want to use. If you want full tablet LS after each switch Try something like:

  - (IBAction) Remove controller all Sbwu main scene Segmentkantrolindaks turned {// Views (UIView * Self.view subviews)) [[view viewFromSuperview]; } Switch (own. Segmented control. Selected Sejment index) {case 0: Grahklistuvint Controller * Grahklist Vij controller = [[customer Lestwu controller allocation] Init]; [Self.view addubview: customerListViewController.view]; break; Case 1: SelectCustomerviewController * selectCustomerviewController = [[SelectCustomerviewController alloc] init]; [Self.view addubview: * selectCustomerviewControllerr.view]; break; Case 2: Invoislist Viaiuai controller * Invoice LISTViewController = [[InvoiceListViewController alloc] init]; [Self.view addubview: invoiceListViewController.view]; break; Default: Break; }}    

Comments