问题
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