Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.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/7/image/5.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 以编程方式调用的情节提要ViewController缓慢加载图像_Ios_Image_Swift_Viewcontroller - Fatal编程技术网

Ios 以编程方式调用的情节提要ViewController缓慢加载图像

Ios 以编程方式调用的情节提要ViewController缓慢加载图像,ios,image,swift,viewcontroller,Ios,Image,Swift,Viewcontroller,我设计了一个带有两张图片的视图。当我在Interface Builder中选中初始视图控制器时,它显示良好,包括图像。如果我通过代码调用它,图像只会在大约30秒后加载。我的图像在images.xcsets-file中定义。如果我将此文件放在根项目目录或子文件夹中,则没有区别 这就是我调用视图的方式: // Tried different bundles here, e.g. NSBundle.mainBundle() or nil : var storyboard = UIStoryboard(

我设计了一个带有两张图片的视图。当我在Interface Builder中选中初始视图控制器时,它显示良好,包括图像。如果我通过代码调用它,图像只会在大约30秒后加载。我的图像在images.xcsets-file中定义。如果我将此文件放在根项目目录或子文件夹中,则没有区别

这就是我调用视图的方式:

// Tried different bundles here, e.g. NSBundle.mainBundle() or nil :
var storyboard = UIStoryboard(name: "Main", bundle: parentView.nibBundle) 
var loginView : LoginViewController = storyboard.instantiateViewControllerWithIdentifier("LoginViewController") as LoginViewController!

// Tried different PresentationStyle here, e.g. "FullScreen" :
loginView.modalPresentationStyle = UIModalPresentationStyle.Popover 
parentView.presentViewController(loginView, animated: true, completion: nil)

我也有同样的问题。我试图支持应用程序内本地化,不完全基于iOS,而是利用它的一些优势。我使用多个故事板本地化,但当启动一个新的程序,我得到的图像丢失。你设法解决了吗?不幸的是,我还不能解决这个问题-但我意识到图像出现在大约30秒后。因此,我有更多的缓慢加载问题,而不是没有图像的问题。您是否尝试在视图中等待,以便我们仍然存在相同的问题?我将编辑我的帖子以反映新的行为。