Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在ios中更改配置文件图片按钮_Ios_Iphone - Fatal编程技术网

在ios中更改配置文件图片按钮

在ios中更改配置文件图片按钮,ios,iphone,Ios,Iphone,我想创建更改配置文件图片按钮,如下图所示。我是ios的新手,我有一个想法,用这些按钮创建一个视图,并将背景不透明度设置为50。我只是想知道xcode或ios是否有与下图相同的默认功能 使用以下代码: UIActionSheet *action=[[UIActionSheet alloc]initWithTitle:@"Change Profile Picture" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle

我想创建更改配置文件图片按钮,如下图所示。我是ios的新手,我有一个想法,用这些按钮创建一个视图,并将背景不透明度设置为50。我只是想知道xcode或ios是否有与下图相同的默认功能

使用以下代码:

  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
类谢谢..我现在知道我要做什么了。