在ios中更改配置文件图片按钮
我想创建更改配置文件图片按钮,如下图所示。我是ios的新手,我有一个想法,用这些按钮创建一个视图,并将背景不透明度设置为50。我只是想知道xcode或ios是否有与下图相同的默认功能 使用以下代码:在ios中更改配置文件图片按钮,ios,iphone,Ios,Iphone,我想创建更改配置文件图片按钮,如下图所示。我是ios的新手,我有一个想法,用这些按钮创建一个视图,并将背景不透明度设置为50。我只是想知道xcode或ios是否有与下图相同的默认功能 使用以下代码: UIActionSheet *action=[[UIActionSheet alloc]initWithTitle:@"Change Profile Picture" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle
UIActionSheet *action=[[UIActionSheet alloc]initWithTitle:@"Change Profile Picture" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Remove Current Photo" otherButtonTitles:@"Import From Facebook",@"Import From Twitter",@"Take Photo",@"Choose From Library", nil];
[action showInView:self.view];
并使用下面的代码为actionsheet按钮单击action
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex==0)
{
}
else if (buttonIndex==1)
{
}
...
}
使用此代码:
UIActionSheet *action=[[UIActionSheet alloc]initWithTitle:@"Change Profile Picture" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Remove Current Photo" otherButtonTitles:@"Import From Facebook",@"Import From Twitter",@"Take Photo",@"Choose From Library", nil];
[action showInView:self.view];
并使用下面的代码为actionsheet按钮单击action
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex==0)
{
}
else if (buttonIndex==1)
{
}
...
}
看看这个。您最好使用内置的
UIActionSheet
类谢谢..我现在知道我要做什么了。看看这个。您最好使用内置的UIActionSheet
类谢谢..我现在知道我要做什么了。