¾ÛÅøÁî
46.¢½.168.138
46.¢½.168.129
46.¢½.168.161
46.¢½.168.136
46.¢½.168.145
46.¢½.168.162
46.¢½.168.144
46.¢½.168.140
115.¢½.135.198
46.¢½.168.139
 
°Ô½Ã¹° 223°Ç
   
¾Èµå·ÎÀÌµå ±×¸®µåºä ¼Ò½º Çؼ®Á» µµ¿ÍÁÖ¼¼¿ä ¤Ð¤Ð(¼öÁ¤)
±Û¾´ÀÌ : ±èżº                   ³¯Â¥ : 2011-09-10 (Åä) 16:59 Á¶È¸ : 6987
¾È³çÇϼ¼¿ä Áö³­¹ø¿¡ Áú¹®±Û ¿Ã·È´ø ÀÎÅÏÀÔ´Ï´Ù.ÁÖ¸»¿¡ ½¬°í¿À´Ï±î ¸Ó¸®°¡ Á» »óÄèÇØÀú¼­ ±×·±Áö Àú¹øÁÖº¸´Ù ¼Ò½º¸¦ Á¶±Ý ħÂøÇÏ°Ô Çؼ®ÇÏ°Ô됬³×¿ä. Àü¿£ ¾Æ¿¹¾Èº¸¿´´Âµ¥...
Áö³­¹ø¿¡ ´äº¯ÁֽŠȣ±º´Ô °¨»çÇÕ´Ï´Ù.
±æ°Ô ´äº¯ÇÏ´Â°Ô ±ÍÂúÀ¸½Ã¸é ÁÖ¼®´Ü°Å Àо½Ã°í µû·Î ¼³¸í ¾ÈÇϽðí o,x¸¸À¸·Î¶óµµ ¾Ë·ÁÁֽøé Á¤¸» °¨»çÇÏ°Ú½À´Ï´Ù...¹¹¶óÇصµ Ʋ¸° Á¤º¸¸¦ ¸Â´Ù°í »ý°¢ÇÏ°íÀÖÀ¸¸é ÈÄ¿¡ Å« ¹®Á¦°¡ µÇ´Ï±î¿ä...¤Ð¤Ð
 
 
private Context mContext;    :namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
        public ImageAdapter(Context c) {  
                mContext = c; 
                }  
//context¸¦ mcontext¶ó´Â À̸§À¸·Î ¼±¾ðÇØÁØ´ÙÀ½¿¡ ImageAdapter¿¡¼­»ç¿ëÇÑ´Ù°í ÇÕ´Ï´Ù.c¶ó´Â º¯¼ö´Â context±â´ÉÀ» °®´Â´Ù°í ¼±¾ðÇÏ°í mContext¶ó´Â º¯¼ö¿¡ c(context)¸¦ ³Ö½À´Ï´Ù.
ÀÌ·¸°ÔÇÏ´Â ÀÌÀ¯´Â ImageAdapter´Â Context¸¦ ÇÊ¿ä·ÎÇÏ´Â ±â´ÉÀ̱⶧¹®ÀÔ´Ï´Ù.
±Ã±ÝÇÑÁ¡Àº ±×³É Context°¡ ÇÊ¿äÇϸé context¶ó°í ½á¼­ ±â´ÉÀ» »ç¿ëÇÏ¸é ¾ÈµÇ°í ÀÌ·¸°Ô º¹ÀâÇÏ°Ô ´Ù¸¥º¯¼ö¿¡ Áý¾î³Ö¾î¼­ »ç¿ëÇؾ߸¸ Çϴ°¡ÀÔ´Ï´Ù.
 
        public int getCount() {   
                return mThumbIds.length;  
                }   
//intÇü getCount¶ó´ÂÀ̸§À¸·Î ÇÔ¼ö¸¦ »ý¼ºÇÏ°í mThumbIds¶ó´Â À̸§ÀÇ º¯¼öÀÇ ±æÀÌ°ªÀ» Àü´ÞÇØÁÝ´Ï´Ù.±×¸®°í getcount¸¦ Æ÷ÇÔÇÑ ¾Æ·¡ÀÇ ÇÔ¼ö4°³´Â baseAdapter class»ç¿ëÇÒ¶§ ¹Ýµå½Ã Æ÷ÇԵǾî¾ß ÇÏ´Â ³»¿ëÀÇ ÇÔ¼öµéÀ̶ó°í Çϳ׿ä.
        public Object getItem(int position) {      
                return null;  
                }  
// getItem À̶ó´Â À̸§ÀÇ ÇÔ¼ö¸¦ »ý¼±Çϸ鼭 intÇü positionÀ̶ó´Â º¯¼ö¸¦ »ý¼ºÇÕ´Ï´Ù.ÀÌ ÇÔ¼ö´Â NUll°ªÀ» º¸³»ÁÝ´Ï´Ù. ÀÌ Object¶ó´Â Çü½ÄÀº Ŭ·¡½ºµéÀÇ °¡Àå ÃÖ»óÀ§ Ŭ·¡½º·Î Çü½Ä ÁöÁ¤°°Àº°Ô ¾Ö¸ÅÇÒ¶§ ½áµµµÈ´Ù°í ...Áö½ÄÀÎ Çü´ÔÀº ¸»¾¸ÇϽó׿ä..;
Á» Àç¹Õ´Ù°í »ý°¢ÇÑ°Ô Áö±Ý±îÁø º¯¼ö¼±¾ðÀ̳ª ÇÔ¼öÀÇ Çü½Ä ¼±¾ðÀº int char ÀÌ·±°Å¸¸ ½á¿Ô´Âµ¥(c¾ð¾î) Àú·±½ÄÀ¸·Î À̹̠¸¸µé¾îÁ®ÀÖ´Â ÇÔ¼öÀÎÁö Ŭ·¡½ºÀÎÁö ¾Æ¹«Æ° Àú·±°Íµµ Çü½ÄÀ¸·Î ÁöÁ¤ÇØ ÁÙ ¼öÀÖ´Â °Í °°´õ±º¿ä..Á¦°¡ »ý°¢ÇÏ°íÀÖ´Â°Ô ¸Â³ª¿ä?
 
 
        public long getItemId(int position) {  
                return 0;  
                }  
 
//À§¿Í °°½À´Ï´Ù. ´Ù¸¸ getItemId´Â 0À» ¸®ÅÏÇÕ¤¾´Ï´Ù. ¹æ±ÝÈ®ÀÎÇѰǵ¥
getItem.getView.getCount.getItemId 4°³ÇÔ¼ö´Â ÇÔ¼ö À̸§¸¸ ¹Ù²ãµµ ¹Ù·Î ¿¡·¯°¡³ª´õ±º¿ä. ÇÔ¼öÀ̸§Àº ±×´ë·ÎµÎ°í getitemÇÏ°í itemidÀÇ Çü½Ä°ú ¸®Åͳ»¿ë¸¸ ±×´ë·Î¹Ù²ãÄ¡±â Çߴµ¥µµ ¿¡·¯³ª°í baseApdater¾µ¶§ Çʼö·Î µé¾î°¡´Â ÇÔ¼ö¶ó´Â ¸»ÀÌ ±× ¸»ÀÎ °Í °°³×¿ä. ÀÌ ÇÔ¼ö4°³´Â baseAdatper¾µ¶§ ¹Ýµå½Ã À̳»¿ë ±×´ë·Î µé¾î°¡¾ßÇѴٴ°Š¸Â³ª¿ä(mThumbº¯¼öÀ̸§À̶û. ImageView À̸§¸¸ »©°í ´Ù ±×´ë·Î)
    
        public View getView(int position, View convertView, ViewGroup parent) { 
                ImageView imageView;
//View ±â´ÉÀ» °®°íÀÖ´Â getView¶ó´Â ÇÔ¼ö¸¦ »ý»êÇÕ´Ï´Ù.(¾Æ¸¶ View¶ó´Â Ŭ·¡½º?ÇÔ¼ö?´Â gridview±â´ÉÀ» Æ÷ÇÔÇÏ°íÀִ ÀÌ ±×¸®µåºä¾î ÇÁ·Î±×·¥¿¡¼± ÇʼöÀûÀÎ ±â´ÉÀÌ°ÚÁÒ) ±×¸®°í ÀÎƼÀú Çü½ÄÀ¸·Î Æ÷Áö¼Ç, View Çü½ÄÀ¸·Î convertView, ViewGrouÇü½ÄÀ¸·Î parent¶ó´Â º¯¼ö¸¦ ¼±¾ðÇØÁÝ´Ï´Ù.) ¸¶Áö¸·À¸·Î ImageView´Â imageView¶ó´Â À̸§À» °®´Â´Ù°í ¼±¾ðÇØÁÝ´Ï´Ù.       
 
        if (convertView == null) { 
                // if it's not recycled, initialize some attributes          
                imageView = new ImageView(mContext);           
                imageView.setLayoutParams(new GridView.LayoutParams(85, 85));           
                imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);          
                imageView.setPadding(8, 8, 8, 8);        }
 
//ImageView¸¦ »õ·Î »ý¼±ÇÏ°í ImageView´Â contextÀÇ ±â´ÉÀ» °®°íÀÖ½À´Ï´Ù.(Çʼö ¹®ÀåÀ̶ó°í »ý°¢µË´Ï´Ù. ¿©±â¼­ ±Ã±ÝÇÑ°Ç ¸ÇÀ§¿¡ Áú¹®¿¡¼­ Àû¾ú´Âµ¥ ÀÌ°É ¿Ö ±ÍÂú°Ô mContext¶ó°í ½á¾ßÇÏ´ÂÁö ÀÔ´Ï´Ù. ±×³É Context¶ó°í ¾²¸é ¾ÈµÇ´Â ÀÌÀ¯°¡...) ³ª¸ÓÁö´Â »çÀÌÁî °ü·ÃÀÔ´Ï´Ù. 
 
        else {         
                imageView = (ImageView) convertView;   
                }       
 
//À̹ÌÁö°¡ ÀÖÀ»°æ¿ì¶ó´Âµ¥. À̺κи¸ Á¶±Ý ¼³¸í ÇØÁÖ½Ã¸é °¨»çÇÏ°Ú½À´Ï´Ù...
À̹ÌÁö°¡ ÀÖÀ»°æ¿ì imageView ¿¡ convertView´Ï±î ¾Æ¸¶ View¿¡ ³²¾ÆÀÖ´Â À̹ÌÁö°ÚÁÒ ¸¦ ³Ö´Â´Ù´Â°Çµ¥ ¾Õ¿¡(ImageView)ÀÇ Àǹ̸¦ ¸ð¸£°Ú³×¿ä
 
        imageView.setImageResource(mThumbIds[position]);       
        return imageView;    }  
 
//imageView¿¡ ImageResource¸¦ ¼ÂÆÃÇÏ°í ±× ResourceÀÇ ¾È¿¡´Â mThumBIds¹è¿­ÀÇ À̹ÌÁöµéÀ» ¼ø¼­´ë·Î ³Ö´Â´Ù) ±×¸®°í imageView °ªÀ» ¸®ÅÏÇÑ´Ù. (set.ImageResource ¶ó´Â ºÎºÐµµ ÇʼöÀûÀÎ ºÎºÐÀÎ °Í °°Àºµ¥ ±â¾ïÇص־߰ÚÁÒ?) 
// references to our images   
private Integer[] mThumbIds = {   R.drawable.sample_2, R.drawable.sample_3,          
                R.drawable.sample_4, R.drawable.sample_5,           
                R.drawable.sample_6, R.drawable.sample_7,           
                R.drawable.sample_0, R.drawable.sample_1,          
                R.drawable.sample_2, R.drawable.sample_3,          
                R.drawable.sample_4, R.drawable.sample_5,           
                R.drawable.sample_6, R.drawable.sample_7,           
                R.drawable.sample_0, R.drawable.sample_1,          
                R.drawable.sample_2, R.drawable.sample_3,          
                R.drawable.sample_4, R.drawable.sample_5,          
                R.drawable.sample_6, R.drawable.sample_7   
                };
}
 
// Integer¶ó´Â°Ô int ÀÇ ¾î¼°í Àú¼´Â ±â´ÉÀ» Æ÷ÇÔÇؼ­ °°ÀÌ ³Ö¾îµÐ Ŭ·¡½ºÀ̸§ÀÌ´õ±º¿ä. ±×·¡¼­±×³É int·Î ½áºÃ´Âµ¥ ¶È°°ÀÌ µÇ´õ¶ó±¸¿ä. ±»ÀÌ ±Ã±ÝÇÑ°Ç ¿Ö int¸¦ ¾È¾²°í Integer¸¦ 썻³ª ÇÏ´ÂÁ¡ Á¤µµ±¸¿ä....ÀÌÇØ°¡ ¾È°¡´Â°Å µÎ°¡Áö´Â
 
¾î¶ó..int´Â Á¤¼öÇüÀε¥ ¾î¶»°Ô ¹è¿­¾È¿¡ Á¤¼ö "°ª"ÀÌ ¾Æ´Ï¶ó. ±×¸²ÀÌ ÀúÀåµÈ ÁÖ¼Ò°¡ µé¾î°¥ ¼ö ÀÖÁö?? Àú°Ô °¡´ÉÇÑ°¡...?¶ó´Â »ý°¢ÀÌ µé¾ú³×¿ä...°¡´ÉÇÏ´Ï±î µÈ°Å°ÚÁö¸¸..Àú°Ô°¡´ÉÇØ¿ä??;;
 
Çϳª ´õ ±Ã±ÝÇÑ°Ç. º¸½Ã¸é »çÁøÀÌ ÃÑ 8ÀåÀÔ´Ï´Ù. ¶È°°Àº»çÁøÀÌ ¿©·¯¹ø Ãâ·ÂµÇÁÒ...Àý´ë ¹«Á¶°Ç ´ç¿¬È÷ µÈ´Ù°í »ý°¢Çؼ­ ¾ÈÇÏ°íÀÖ¾ú´Âµ¥ °­¾ÆÁö ±×¸²ÀÌ Áú·Á¼­ À©µµ¿ì¿¡ ÀÖ´Â »çÁø 14Àå ´õ »©¿Í¼­ sample_21±îÁö ¸¸µé¾ú½À´Ï´Ù...±Ùµ¥ ¿ô±ä°Ç Àú ¹è¿­ÁÖ¼Ò¿¡ 0ºÎÅÍ 21±îÁö ´Ù ½á³Ö¾ú´Âµ¥ ¿¡·¯°¡ ³ª´Â°Å¿¡¿ä...sample_12±îÁö´Â ¿¡·¯°¡¾È³³´Ï´Ù...»çÁøÀÌ ¹®Á¦Àΰ¡Çؼ­ 13¹ø »ùÇÃÀ» 12¹øÀ¸·Î ¹Ù²ãºÃ´Âµ¥ ¿¡·¯°¡ ¾È³ª´õ±º¿ä...»çÁø¹®Á¦µµ ¾Æ´Ï°í sample_13¹ø ÀÌ»óÀ¸·Î ÀúÀåµÈ À̸§ÀÌ Çϳª¶óµµ µé¾î°¡¸é ¿¡·¯°¡³ª³×¿ä...À̰Ǿƹ«¸®ºÁµµ Àý´ë ÀÖÀ»¼ö°¡ ¾ø´ÂÀÏÀε¥...ÀüÇô ÀÌÇØ°¡¾È°¡¿ä.
 
¾Æ..Á˼ÛÇÕ´Ï´Ù ÇÑ°¡Áö¸¸´õ ¤Ð
¹è¿­ °¹¼ö [] ¾È¿¡, ÇöÀç »çÁøÀÇ °¹¼ö°¡ ÃÑ 22°³¶ó¼­ 22¸¦ 썻´Âµ¥..¿Ö Àú ´ë°ýÈ£ ¾È¿¡ ¼ýÀÚ¸¸ Àû¾î³ÖÀ¸¸é mThumbº¯¼ö¿¡ »¡°£ÁÙÀÌ »ý±æ±î¿ä...
 
 
°³¹ßÀÚ ÇÁ·Î±×·¡¸Ó Çü´Ô ´©³ª µ¿»ý »ïÃ̺еé Á¤¸» °£ÀýÈ÷ ´äº¯À» ¿øÇÕ´Ï´Ù. µµ¿ÍÁÖ¼¼¿ä Çø®Áî
Çѱ¹°¡¸é ¹ä»çµå¸±°Ô¿ä Á¦¹ß ¤Ð.¤Ð
* ±ÛÀ» µî·ÏÇϽǶ§ ²À ÇÊ¿äÇÑ °æ¿ì°¡ ¾Æ´Ï¸é °³ÀÎÁ¤º¸¸¦ ³²±âÁö ¸¶¼¼¿ä ^^ (¿¬¶ôó,À̸ÞÀÏÁÖ¼Ò,Áֹεî·Ï¹øÈ£ µî)




±èżº ´ÔÀÇ Q&A ÃÖ½Å±Û [´õº¸±â]


 
±èº´ÁÖ 2011-09-26 (¿ù) 18:12
¾Æ... ¿ì¼± BASEADAPTER¿¡ ´ëÇÑ ±âº» °³³äÀ» ¼³¸íÇؾߵǴµ¥ ±æ¾îÁú°Í°°À¸´Ï ´ä±Û·Î´Þµµ·Ï ÇÏ°Ú½À´Ï´Ù.
´ä±ÛÈ®ÀκÎŹ..
   

°Ô½Ã¹° 223°Ç
¹øÈ£ Á¦¸ñ ±Û¾´ÀÌ ³¯Â¥ Á¶È¸
223  ¾Èµå·ÎÀ̵å GridView¿¡ À̹ÌÁö ºÒ·¯¿À±â +1 ÃÖ¼öÀÎ 04-16 7063
222  Ä«Ä«¿À¸µÅ© API¸¦ ÀÌ¿ëÇØ Ä£±¸¸¦ ÃÊ´ëÇÒ¶§ ? ÀÌÀ翵 11-15 6921
221  ¾Èµå·ÎÀÌµå ¾Û ½É»ç±â°£ÀÌ ¿Ö ÀÌ·¸°Ô ±æ¾î Á³³ª¿ä? ÀüºÀ±â 03-19 7214
220  ºÎ»ê ¾Èµå·ÎÀÌµå ½ºÅ͵ð ¸ðÁý °ü·ÃÇÏ¿© ¹®Àǵ帳´Ï´Ù +2 ÀÌÀç¿ø 02-26 6247
219  ºÎ»ê ½ºÅ͵ð...14±â´Â ¾ðÁ¦ÂêÀ½ ¸ðÁý Çϳª¿ä?? +1 ±è¼ÒÇö 02-01 3893
218  2014³â °æ³²,°æºÏ Áö¹æ¿¡¼­ ÇÏ´Â ¾Û °³¹ß°ú ¾Û µðÀÚÀÎ ±³À° °úÁ¤ Á» ¾Ë·ÁÁÖ¼¼¿ä À¯ÇöÀç 01-02 3763
217  ¾Èµå·ÎÀÌµå ½ºÅ͵𿡠°¡ÀÔÇÏ°í ½ÍÀº ÇлýÀÔ´Ï´Ù. ÀÌÀåÈ£ 12-31 3783
216  ¾Èµå·ÎÀ̵å ÇÁ·¹ÀÓ¿öÅ© °ü·ÃÇÏ¿© Áú¹®µå¸³´Ï´Ù. Çѱ¤Èñ 10-01 3900
215  ¾È³çÇϼ¼¿ä ^^ À̹ÌÁö ÇÊÅÍ È¿°ú °ü·Ã Áú¹®µå¸³´Ï´Ù. ±Çöȣ 07-10 4427
214     ¾È³çÇϼ¼¿ä ^^ À̹ÌÁö ÇÊÅÍ È¿°ú °ü·Ã Áú¹®µå¸³´Ï´Ù. ±èº´ÁÖ 08-02 5104
213  ½º¸¶Æ®Æù µð¹ÙÀ̽º Á¦¾î¹æ¹ý.. Á¤¹Î½Ä 06-20 3674
212     ½º¸¶Æ®Æù µð¹ÙÀ̽º Á¦¾î¹æ¹ý.. ±èº´ÁÖ 08-02 5116
211  http ÆÄ½Ì °í¼ö´ÔµéÀÇ Á¶¾ðÀÌ ÇÊ¿äÇØ¿ä !! ¤Ð¤Ð 俵Áø 06-10 3854
210     http ÆÄ½Ì °í¼ö´ÔµéÀÇ Á¶¾ðÀÌ ÇÊ¿äÇØ¿ä !! ¤Ð¤Ð ±Ç´ë°Ç 06-20 4745
209        http ÆÄ½Ì °í¼ö´ÔµéÀÇ Á¶¾ðÀÌ ÇÊ¿äÇØ¿ä !! ¤Ð¤Ð ±èº´ÁÖ 08-02 4840
208  ±¸±Û Ç÷¹ÀÌ ¸¶ÄÏ¿¡ µî·ÏµÈ ¾Û ¼³¸í¹® ¼öÁ¤½Ã ¾Û ·©Å·¿¡ ¿µÇâÀÌ Àִٴµ¥¿ä? ÀÌÀ翵 05-29 4985
207  ÀÌŬ¸³½º¿¡¼­ ¾Û°³¹ß½Ã index.html ¼Ò½º ¹Ù·Î º¸´Â ¹æ¹ýÀÌ ¾î¶»°Ô µÇ³ª¿ä? ±èÀϼö 05-01 4085
206  ¾×ƼºñƼ°£ ¼ÒÄÏ¿¬°áÀ¯Áö Áú¹®ÀÌ¿ä +2 ¼Ûº¸±Ù 01-29 10080
205  ¾Èµå·ÎÀ̵å 1pxÀ» mm·Î ȯ»êÇÏ´Â ¹®Á¦ÀÔ´Ï´Ù +1 ÀÌÅÂÇü 12-18 5573
204  À¯·á¾ÛÀ» ¿Ã·È´Âµ¥ °áÁ¦¿¡¼­ ¿¡·¯°¡ ³ª¼­ ¾Æ¹«µµ ¾È¹Þ¾Ò³×¿ä. ¤Ì¤Ì ÀÌ°Å ¿Ö ÀÌ·¸ÁÒ?? µµ¿ÍÁÖ¼¼¿ä. ¤Ð¤Ð +1 ±èÅÂÇü 12-13 4861
 1  2  3  4  5  6  7  8  9  10  11  12  
 
 
 
Copyright ¨Ï wwwold.androidstudy.co.kr. All rights reserved.