从资源文件夹加载200以上的图像有什么问题吗?

时间:2022-06-16 00:25:57

My application contains more than 200 images each with size approx. 15 KB. I want to flip these image one by one. Is there will be any time lag for loading images? Is there any alternate method for doing that?

我的应用程序包含200多个图像,每个图像的大小约为。 15 KB。我想逐个翻转这些图像。加载图像会有任何时间滞后吗?有没有其他方法可以做到这一点?

Anyone please help!

有人请帮忙!

1 个解决方案

#1


2  

My application contains more than 200 images each with size approx. 15 KB. I want to flip these image one by one.

我的应用程序包含200多个图像,每个图像的大小约为。 15 KB。我想逐个翻转这些图像。

OK.

好。

Is there will be any time lag for loading images?

加载图像会有任何时间滞后吗?

Maybe. Try it and see. If there is, run your app under Instruments to see what really caused it.

也许。试试看吧。如果有,请在“仪器”下运行您的应用程序以查看真正导致它的原因。

Is there any alternate method for doing that?

有没有其他方法可以做到这一点?

You haven't proposed a primary method to be alternate to.

您尚未提出替代的主要方法。

The main thing is that, since this is an iPhone app, you're probably not going to need 200 images loaded at once. Consider the Home screen: Those icons are about as small as is practical, and there are only 20 (24 on the iPad) of them on the screen at one time.

最重要的是,由于这是一个iPhone应用程序,您可能不会需要一次加载200个图像。考虑主屏幕:这些图标大小与实际一样小,屏幕上一次只有20个(iPad上有24个)。

Assuming you want to allow scrolling or paging through the list, you'll probably want to keep a pageful up and a pageful down already loaded and flipped and ready to display, to make scrolling/paging faster. That's still only 60–72 images, and you can do half to two-thirds of them after displaying the visible 20–36.

假设你想允许在列表中滚动或分页,你可能希望保持页面向上并且已经加载并翻转并准备好显示页面向下,以使滚动/分页更快。这仍然只有60-72张图像,你可以在显示20-36之后显示其中一半到三分之二的图像。

Moreover, are the images always flipped? If so, then flip them at build time and copy the flipped images into your app, and do no flips at runtime. Then you're just displaying images.

此外,图像是否总是翻转?如果是这样,那么在构建时将它们翻转并将翻转的图像复制到您的应用程序中,并在运行时不进行翻转。然后你只是显示图像。

#1


2  

My application contains more than 200 images each with size approx. 15 KB. I want to flip these image one by one.

我的应用程序包含200多个图像,每个图像的大小约为。 15 KB。我想逐个翻转这些图像。

OK.

好。

Is there will be any time lag for loading images?

加载图像会有任何时间滞后吗?

Maybe. Try it and see. If there is, run your app under Instruments to see what really caused it.

也许。试试看吧。如果有,请在“仪器”下运行您的应用程序以查看真正导致它的原因。

Is there any alternate method for doing that?

有没有其他方法可以做到这一点?

You haven't proposed a primary method to be alternate to.

您尚未提出替代的主要方法。

The main thing is that, since this is an iPhone app, you're probably not going to need 200 images loaded at once. Consider the Home screen: Those icons are about as small as is practical, and there are only 20 (24 on the iPad) of them on the screen at one time.

最重要的是,由于这是一个iPhone应用程序,您可能不会需要一次加载200个图像。考虑主屏幕:这些图标大小与实际一样小,屏幕上一次只有20个(iPad上有24个)。

Assuming you want to allow scrolling or paging through the list, you'll probably want to keep a pageful up and a pageful down already loaded and flipped and ready to display, to make scrolling/paging faster. That's still only 60–72 images, and you can do half to two-thirds of them after displaying the visible 20–36.

假设你想允许在列表中滚动或分页,你可能希望保持页面向上并且已经加载并翻转并准备好显示页面向下,以使滚动/分页更快。这仍然只有60-72张图像,你可以在显示20-36之后显示其中一半到三分之二的图像。

Moreover, are the images always flipped? If so, then flip them at build time and copy the flipped images into your app, and do no flips at runtime. Then you're just displaying images.

此外,图像是否总是翻转?如果是这样,那么在构建时将它们翻转并将翻转的图像复制到您的应用程序中,并在运行时不进行翻转。然后你只是显示图像。