Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.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 一旦调用view,通过IB设置图像的UIImageView将花费大约10秒的时间显示_Ios_Objective C_Uiviewcontroller_Uiimageview - Fatal编程技术网

Ios 一旦调用view,通过IB设置图像的UIImageView将花费大约10秒的时间显示

Ios 一旦调用view,通过IB设置图像的UIImageView将花费大约10秒的时间显示,ios,objective-c,uiviewcontroller,uiimageview,Ios,Objective C,Uiviewcontroller,Uiimageview,我有一个UIView,然后我使用下面的代码将另一个UIView作为子视图添加到该视图中 TestViewController* holesaw = [[TestViewController alloc] init]; holesaw.view.frame = CGRectMake(0, [UIApplication sharedApplication].statusBarFrame.size.height + 44, holesaw.view.frame.size.width, 454); [s

我有一个
UIView
,然后我使用下面的代码将另一个
UIView
作为子视图添加到该视图中

TestViewController* holesaw = [[TestViewController alloc] init];
holesaw.view.frame = CGRectMake(0, [UIApplication sharedApplication].statusBarFrame.size.height + 44, holesaw.view.frame.size.width, 454);
[self addChildViewController:holesaw];
[holesaw didMoveToParentViewController:self];
[self.view addSubview:holesaw.view];

子视图有一个
UIImageView
,其中一个图像设置为通过IB显示。加载几乎需要10秒。有人知道为什么吗?我已尝试将该图像同时用作.jpg和.png,但它只是一个200kb的图像。

您正在当前控制器中添加另一个控制器的视图吗?(此视图包含UIImageView)您在哪里运行此代码?可能需要确保它在主线程上。它在主线程上。是的@sebastienFCT这就是我正在做的。你是下载图片还是从捆绑包中加载?它在应用捆绑包中。