0
更新我的iPad和Xcode的到最新的版本的iOS5和Xcode的4.2運行我在iPad上的應用程序,在風景查看分屏的工作原理後經過UIPopover/Sliptview問題,因爲它應該,在那裏因爲當我然後將其旋轉到縱向視圖,然後按下按鈕/菜單圖標我得到彈出窗口,但沒有內容只是彈出窗口的頂部出現。見圖像附的iOS5:升級到iOS5的在Xcode
菜單按鈕通過代碼產生不與一個普通按鈕見下文:
-(void)viewMenu:(id)sender{
[self.popoverController presentPopoverFromRect:self.view.frame
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionUp
animated:YES];
[self.popoverController presentPopoverFromRect:CGRectMake(10.0f, 50.0f, 10.0f, 10.0f) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}
菜單列表經由的plist代碼填充。
多一點SPLITVIEW代碼如下:
- (void)splitViewController:(UISplitViewController *)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController: (UIPopoverController *)pc
{
barButtonItem.title = @"Menu";
self.toolbar.tintColor = [UIColor colorWithRed:254.0/255.0 green:193.0/255.0 blue:32.0/255.0 alpha:1.0];
self.toolbar.hidden = YES;
NSMutableArray *items = [[self.toolbar items] mutableCopy];
[items insertObject:barButtonItem atIndex:0];
[self.toolbar setItems:items animated:YES];
[items release];
self.popoverController = pc;
viewMenu.hidden = NO;
}
// Called when the view is shown again in the split view, invalidating the button and popover controller.
- (void)splitViewController:(UISplitViewController *)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem
{
NSMutableArray *items = [[self.toolbar items] mutableCopy];
[items removeObjectAtIndex:0];
[self.toolbar setItems:items animated:YES];
[items release];
self.popoverController = nil;
viewMenu.hidden = YES;
}
任何想法whays怎麼回事,我該如何解決這個問題?
在viewMenu,爲什麼presentPopoverFromRect叫了兩聲?第二個電話看起來是正確的。 – Anna