Iphone UIActionSheet定制

Iphone UIActionSheet定制,iphone,iphone-sdk-3.0,Iphone,Iphone Sdk 3.0,你能控制文本的大小和它在动作表上的对齐方式吗?另外,您能否决定销毁按钮和其他按钮在操作表上的显示顺序?像屏幕截图一样的屏幕是我正在尝试创建的 提前感谢我做了类似的事情来定制一个行动表: -(无效)显示弹出窗口{ unitPicker*pc=[[unitPicker alloc]init]; UIActionSheet*popupQuery=[[UIActionSheet alloc] initWithTitle:@“单位” 代表:pc 取消按钮:无 破坏性按钮:无 其他按钮:无 ]) [pc s

你能控制文本的大小和它在动作表上的对齐方式吗?另外,您能否决定销毁按钮和其他按钮在操作表上的显示顺序?像屏幕截图一样的屏幕是我正在尝试创建的


提前感谢

我做了类似的事情来定制一个行动表:

-(无效)显示弹出窗口{ unitPicker*pc=[[unitPicker alloc]init]; UIActionSheet*popupQuery=[[UIActionSheet alloc] initWithTitle:@“单位” 代表:pc 取消按钮:无 破坏性按钮:无 其他按钮:无 ])

[pc setParent:self];
popupQuery.actionSheetStyle = UIActionSheetStyleBlackOpaque;    
[popupQuery showInView:self.view];

[popupQuery setBounds:CGRectMake(0,0,320, 350)];

[pc setAs:popupQuery];
[popupQuery addSubview:pc.view];
}

诀窍是“unitPicker”源自UIControllerView,但实现了UIActionSheetDelegate协议。它提供了两个功能:

- (void)actionSheet:(UIActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex;
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex;
处理任何清理工作。重要的是unitPicker的格式是从NIB创建的,就像任何UIViewController一样

视图中的按钮取消了操作表,其touchUpInside处理程序中包含代码:

[as dismissWithClickedButtonIndex:0 animated:TRUE];
(您可以在上面的代码中看到,“as”被设置为actionSheet对象)