我正在开发一个iPad应用程序。我已经在其中使用了电子邮件和打印功能。为了显示这些选项,我使用了UIActionSheet。但是UIActionSheet的尺寸太大了。是否可以将frames设置为UIActionSheet以减小其大小?
发布于 2011-11-09 19:34:51
您至少可以更改动作单的高度值,尤其是bounds值。这甚至可以在调用showFromToolbar:等之后立即完成。请注意,这不会重新定位按钮,而似乎只是在操作表的底部添加/删除空格。
在更改布局之前,人们必须问自己这是否真的有必要,或者是否有其他选择,但我见过有必要这样做的情况(例如,UIActionSheet中的UIDatePicker )。
发布于 2014-06-06 19:54:33
- (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
{
}
}https://stackoverflow.com/questions/8063180
复制相似问题