更改视图之前的iOS指示器 [英] IOS indicator before change the view

查看:78
本文介绍了更改视图之前的iOS指示器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个CollectionView,有8个项目。其中一项是TableViewController,然后为单元格BackgroundView下载图像。

i have a collectionView, with 8 Items. One item is TableViewController, and downloading Images for cell BackgroundView.

当我仅单击Item时,TableView将在2-3秒后出现。 (有时5秒,连接不良时)。因此,用户会认为该应用程序已冻结。

When i just click on Item, the TableView appears 2-3 second later. (Sometimes 5sec., when bad connection). For this reason, the users will think the app is frozen.

我要实现一个指示器,该指示器会在加载视图之前显示。
我何时知道TableView已完成下载?

I want to implement an indicator, which appears until the view is loaded. When do i know the TableView is finished with downloading?

因为当我单击该项时, TableViewController中的代码正在运行,但是我看到了collectionView,并在3-4秒后出现

Because when i click the item, the code from "TableViewController" is running, but i see the collectionView, and after 3-4 sec it appears

需要帮助:/

谢谢

推荐答案

我认为您没有将 LazyLoding 用于图像下载
如果您在主线程中下载图像,则应用程序将被卡住,直到未下载并显示该图像。

I think you are not using LazyLoding for Image downloading. If you download image in main Thread then application is stuck until the image is not downloaded and display.

您可以使用 SDWebImage 进行图像下载。

You can use SDWebImage for image downloading.

以下是在您的应用程序中实现的步骤:

Here is the steps to implement into your application:

-单击Zip标记并下载档案。

-Click on Zip tag and download the archive.

-取消存档文件。

-您将找到 SDWebImage文件夹。

-You will find the "SDWebImage" folder.

-查看该路径并将此文件夹添加到您的项目中。 (不要忘了在项目中复制文件夹而不是进行Jusk链接)。

-see that path and add this folder in your project. (don't forget to take copy of folder in your project instead of jusk linking).

快乐编码:)

这篇关于更改视图之前的iOS指示器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆