Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/108.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.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 UIImage视图重置/清空_Ios_Objective C_Uiimageview - Fatal编程技术网

Ios UIImage视图重置/清空

Ios UIImage视图重置/清空,ios,objective-c,uiimageview,Ios,Objective C,Uiimageview,大家好,我正在开发一个iOS应用程序,允许用户使用UIImagePicker拾取图像。现在我必须创建一个操作来恢复UIIageView,其中没有图像。有人能帮我写代码吗 -(IBAction)emptyImage{ //code to empty the UIImageView } 试着用这个 -(IBAction)emptyImage { imageView.image=nil } 希望这对您有所帮助。scrlFirstScroll是从哪里来的?这是怎么一回事?它将如何清空i

大家好,我正在开发一个iOS应用程序,允许用户使用UIImagePicker拾取图像。现在我必须创建一个操作来恢复UIIageView,其中没有图像。有人能帮我写代码吗

-(IBAction)emptyImage{

//code to empty the UIImageView

}

试着用这个

-(IBAction)emptyImage
{
     imageView.image=nil
}

希望这对您有所帮助。

scrlFirstScroll是从哪里来的?这是怎么一回事?它将如何清空imageview?@Durgaprasad现在我将scrlFirstScroll更改为self.view
-(IBAction)emptyImage
{
     imageView.image=nil
}
-(IBAction)emptyImage
{

   NSArray *remoVeSunBVIew = [self.view subviews];
      for(UIView *viw in remoVeSunBVIew)
      {
          [viw removeFromSuperview];
      }
}