2011-11-09 36 views
0

我正在研究iPad應用程序。我已經使用電子郵件和打印功能。爲了顯示這些選項,我使用了UIActionSheet。但UIActionSheet的大小太大了。我可以將框架設置爲UIActionSheet以縮小尺寸嗎?將框架設置爲UIActionSheet

回答

0

您至少可以更改操作表的bounds,特別是高度值。這甚至可以在呼叫showFromToolbar:之後立即完成。請注意,這不會重新定位按鈕,但似乎只是在操作表的底部添加/刪除空間。

在更改佈局之前,必須先問自己這是否真的有必要,或者是否有其他選項,但我已經看到了這種情況(如UIActionSheet中的UIDatePicker)。

0
- (IBAction)openclick:(id)sender 
{ 
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 
    { 


     UIActionSheet *actionsheetttt = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"Click me",@"hows You", nil]; 
     actionsheetttt.tag = 777; 
     actionsheetttt.actionSheetStyle = UIActionSheetStyleBlackOpaque; 
     [actionsheetttt showFromRect:CGRectMake(215,319,300,500) inView:self.view animated:YES]; 
     [actionsheetttt release]; 
} 
    else 
    { 

    } 

}