且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何为iPhone创建自定义弹出窗口?

更新时间:2022-11-20 12:19:42

***的方法是使用UIActionSheet。代码在这里:

The best way to do this is using a UIActionSheet. The code is here:

UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:@"Share" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Facebook",@"Twitter", nil];
[actionSheet showInView:self.view];

UIActionSheet从底部到顶部,有一定数量的按钮要显示。

A UIActionSheet comes from the bottom to the top with a certain number of buttons you wish to display. You can also put a cancel button that will automatically dismiss the UIActionSheet.

下面是它的外观: