2011-11-09 38 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 
    { 

    } 

}