UIActionSheet 显示问题?

wxpwxp 2011-03-24 05:08:14
menu = [[UIActionSheet alloc] initWithTitle:nil
delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:@"Done"
otherButtonTitles:nil];
picker_view = [[UIPickerView alloc] init];
picker_view.showsSelectionIndicator = TRUE;
picker_view.delegate = self;
picker_view.dataSource = self;
[picker_view selectRow:current_symbol_index inComponent:0 animated:FALSE];
UIButton *done_button;

[menu addSubview:picker_view];
[menu showInView:self.view];
[menu setBounds:CGRectMake(0, 0, 320, 480)];
[picker_view setFrame:CGRectMake(0, 80, 320, 216)];
done_button = [[UIButton alloc] initWithFrame:CGRectMake(5, 5, 50, 30)];
[menu addSubview:done_button];


上面在 iphone上显示正常,大小,包括比例 都是设定frame的大小。


但是在 if(UI_USER_INTERFACE_IDIOM()== UIUserInterfaceIdiomPad) ipad下就在中间显示一个很小的方块。
不知道是什么问题。


在上面会显示一个 红色的button done ,但是不知道 destructiveButtonTitle 和done_button 这个是怎么关联的啊
在iphone下就没问题。
但是在ipad修改为[self.view addSubview:menu]; 显示虽然正确,但是done和done_button 并没有关联上,,done变成了一个小lable


那位熟悉这个控件的帮看看什么问题
...全文
346 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

29,028

社区成员

发帖
与我相关
我的任务
社区描述
主要讨论与iOS相关的软件和技术
社区管理员
  • iOS
  • 大熊猫侯佩
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧