How many Views are possible in a view flipper in android?

混江龙づ霸主 提交于 2020-01-11 11:14:09

问题


I am developing an application in android in which i want to show about 170 images, but i want user can view images by finger either right or left . After searching from internet i got a solution, therefore i had use View flipper in my application It will work when the counting of images are 15, when the counting increasing above fifteen it will crash. Can you tell me the reason for this or is there a limitation in view flipper that we cannot show more than 15 views.

Give me any suggession for solve my problem.

Thanks in advance!


回答1:


I suggest you to use Gallery (Gallery tutorial), ViewFlipper will load complete view in memory, so when you load more images it will take more memory and there is good chance for OutOfMemoryError.
For displaying Images Gallery is the best choice




回答2:


The view flipper has not such limitations. Probably the issue is that you're loading in memory all those images. Try to avoid to have more than 2 or 3 images in memory at any given time or you'll run out of RAM



来源:https://stackoverflow.com/questions/6280591/how-many-views-are-possible-in-a-view-flipper-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!