2010-09-02 15 views

cevap

4

İç kısımda - - (BOOL) "OtoAyarmaAyışım" yöntemini denetleyin, aygıt yönünü kontrol edin. Portre ise, kullanıcı çubuğunu tıklattığında görünür hale getirmek için popover'ı olduğu gibi sunun.

En iyisi.

+0

ve bu, denetleyici tam olarak hangi uygulamada uygulanmalıdır? – user102008

+0

ayrık görüntü denetleyicinizin ayrıntılı denetleyicisini görüntüleyin. Herşey gönlünce olsun. – gopikrishnan

+0

bu yöntem iOS 6'da kullanımdan kaldırılmıştır. 'DidRotateFromInterfaceOrientation:' – hop

2

UISplitViewController kendi temsilcisine (UISplitViewControllerDelegate) ileti gönderir. Bu temsilci yöntemini, popover'i göstermek için uygulayabilirsiniz. Eğer "detay denetleyicisi" kodunda böyle bir şey yapabilirsiniz: Benim için çalışmıyor (shouldAutorotateToInterfaceOrientation kullanarak)

#pragma mark - 
#pragma mark UISplitViewControllerDelegate implementation 
- (void)splitViewController:(UISplitViewController*)svc 
    willHideViewController:(UIViewController *)aViewController 
      withBarButtonItem:(UIBarButtonItem*)barButtonItem 
     forPopoverController:(UIPopoverController*)pc 
{ 
    [barButtonItem setTitle:@"Your 'popover button' title"]; 
    self.navigationItem.leftBarButtonItem = barButtonItem; 
} 


- (void)splitViewController:(UISplitViewController*)svc 
    willShowViewController:(UIViewController *)aViewController 
    invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem 
{ 
    self.navigationItem.leftBarButtonItem = nil; 
} 
+0

kullanın Bu temsilcilerde yaptığınız her şey bir düğme gösteriyor. OP, portreye dikey dönüş yaparken görünür olmasını istedi. –

1

kabul cevabı. Ya rotasyon objeleri (4.2 ve 5.0 iPad simülatörlerinde) ya da sadece başlangıçta gösterir ve bir sonraki dönüşlerde (4.3 simülatöründe) bir daha göstermez.

- (void)showPopoverInPortrait { 
    if ([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationPortrait) { 
     [self.masterPopoverController presentPopoverFromBarButtonItem:self.navigationItem.leftBarButtonItem 
              permittedArrowDirections:UIPopoverArrowDirectionAny 
                  animated:YES]; 
    } 
} 

ve ayrıca başlangıçta ele - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation ve - (void)viewDidLoad içinde bu çağrı: Ya yerine yaptım biraz yardımcı işlevi yaratmaktı.

İlgili konular