Android的GridView的教程 - 样品code,它的工作原理?它的、样品、工作原理、教程

2023-09-06 19:19:15 作者:过期氟西汀

我一直在敲我的头靠在墙壁谁能有工作code的帮助:

I have been banging my head against the wall- can anyone help with working code for :

http://developer.android.com/resources/tutorials/意见/ HELLO-gridview.html

我每次code IT- Eclipse中给了我深不可测错误的负载(特别是对于初学者),但即使我复制和粘贴code-它仍然无法与Android 2.2 SDK工作。任何帮助将受到欢迎!

Every time I code it- Eclipse gives me loads of unfathomable errors(especially for a beginner) but even when I copy and paste code- it still doesn't work with android 2.2 sdk. Any help will be welcome!

其次,它也提到一些复制的样本图像到下水库可绘制文件夹,但也有绘制,华电国际,LDPI,MDPI和哪个文件夹 - 我应该复制的影像到(或所有3?)

Secondly it also mentions copying some sample images into the drawable folder under res, however there are drawable-hdpi, ldpi, and mdpi folders- which one should I copy the images into ( or all 3?)

在此先感谢

推荐答案

请看看我给你的问题​​涉及到Android教程评论。关于图像,你应该将它们复制到所有3或创建一个新的目录名为绘。让我更详细一点解释。

Please see my comment to your question related to the Android Tutorials. About the images you should copy them to all 3 OR create a new directory called drawable. Let me explain it with a bit more of detail.

每个设备都有像华电国际,LDPI和MDPI(片剂有甚至更多)的密度。机器人的想法是使用转到这些文件夹最适合您的设备的图像。如果不能找到一个图像,它会寻找它称为一个绘制通用文件夹中。所以,如果你只是测试你的逻辑,不要现在关心的样子,只需要创建绘制文件夹,并把你的图片在那里。

Each device has a density like HDPI, LDPI and MDPI (tablets have even more). The idea of android is to use the images that best fit your device by going to these folders. If it can't find an image, it will look for it on a 'generic' folder called drawable. So, if you're only testing your logic and don't care for the look by now, just create the 'drawable' folder and put your images there.