¾ÛÅøÁî
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 Á¶È¸ : 6986
¾È³çÇϼ¼¿ä Áö³­¹ø¿¡ Áú¹®±Û ¿Ã·È´ø ÀÎÅÏÀÔ´Ï´Ù.ÁÖ¸»¿¡ ½¬°í¿À´Ï±î ¸Ó¸®°¡ Á» »óÄèÇØÀú¼­ ±×·±Áö Àú¹øÁÖº¸´Ù ¼Ò½º¸¦ Á¶±Ý ħÂøÇÏ°Ô Çؼ®ÇÏ°Ô됬³×¿ä. Àü¿£ ¾Æ¿¹¾Èº¸¿´´Âµ¥...
Áö³­¹ø¿¡ ´äº¯ÁֽŠȣ±º´Ô °¨»çÇÕ´Ï´Ù.
±æ°Ô ´äº¯ÇÏ´Â°Ô ±ÍÂúÀ¸½Ã¸é ÁÖ¼®´Ü°Å Àо½Ã°í µû·Î ¼³¸í ¾ÈÇϽðí 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°Ç
¹øÈ£ Á¦¸ñ ±Û¾´ÀÌ ³¯Â¥ Á¶È¸
123  ÇÑ°¡Áö ´õ Áú¹® ÇÏ·Á ÇÕ´Ï´Ù! ¹Ú°¡¶÷ 11-21 3946
122  ÀÌŬ¸³½º µðÄÚµù ÇÏ´Â ¹ý ¾Ë·ÁÁÖ´Â °÷ ¾Æ½Ã´Â ºÐ °è½Å°¡¿ä? ¹Ú°¡¶÷ 11-21 4062
121  ¾Èµå·ÎÀ̵å¿Í C# ¼ÒÄÏÅë½ÅÀä +2 ÃÖ¼¼³ª 11-21 4988
120  ¾Èµå·ÎÀ̵å üÆÃÇÁ·Î±×·¥ ¸¸µå´Âµ¥¿ä.. +4 ¹Ú°¡¶÷ 11-17 4259
119  °¶·°½ÃS2 È÷µç¸Þ´º ÄÁÆ®·Ñ.. °­¼º¾È 11-07 5612
118  ADB ¸í·É¾î¿¡ °ü·ÃÇÑ Áú¹® ÀÔ´Ï´Ù. +1 ÀÌÁ¤Çö 11-03 4429
117  ADB devices ¿¡¼­ ³ª¿À´Â setÀÇ id º¯°æ ¹æ¹ýÀÌ ÀÖ³ª¿ä? ÀÌÁ¤Çö 11-03 6575
116  ¾Èµå·ÎÀ̵å¿Í Çϵå¿þ¾î±â±â Åë½Å¹æ¹ý ¹®Àǵå·Á¿ä +4 °æ 10-25 6205
115  surfaceView ·Î °ÔÀÓ·çÇÁ ±¸ÇöÇϱâ (fps¹®Á¦) +1 À̼º±Ô 10-23 5359
114  ¾Èµå·ÎÀÌµå ¾Û °³¹ß¿¡ °ü½ÉÀÌ ÀÖ´Â ¿ÏÀü Ãʺ¸ÀÔ´Ï´Ù. +8 ±è»óÈ£ 10-03 5162
113  Select¹®ÀÇ where +4 ±èżº 10-03 4497
112  XoomÀ̳ª °¶·°½Ã ÅÇ 10.1¿¡¼­ MediaRecorder »ç¿ë½Ã ¹®Á¦ ³ë°æ¼ö 09-15 4133
111  µ¿¿µ»ó¿¡ ¾Æ·¡ »óÅÂâ ¾È¶ß°Ô ÇÒ¼öÀÖ³ª¿ä?(Á¤Áö, ¾ÕÀ¸·Î,µÚ·Î, ÀϽÃÁ¤Áö ÇöÀç Àç»ý½Ã°£µî) +3 ±èµ¿±Ô 09-15 4485
110  °¶·°½Ã2 Ä«¸Þ¶ó¸ðµå ¹®Á¦ +1 ³²À̼® 09-12 3557
109  ¾Èµå·ÎÀÌµå ±×¸®µåºä ¼Ò½º Çؼ®Á» µµ¿ÍÁÖ¼¼¿ä ¤Ð¤Ð(¼öÁ¤) +1 ±èżº 09-10 6987
108     ¾Èµå·ÎÀÌµå ±×¸®µåºä ¼Ò½º Çؼ®Á» µµ¿ÍÁÖ¼¼¿ä ¤Ð¤Ð(¼öÁ¤) +1 ±èº´ÁÖ 09-26 6527
107  mmssms.db°ü·Ã¹®ÀÇÀÔ´Ï´Ù! +2 Á¤Çõ 09-09 4459
106  ¿î¼¼API´Â ¾ø³ª¿ä? +3 Çã¹®Çà 09-08 8502
105  Ãʺ¸ÀÚÀÔ´Ï´Ù. ¿¹¹Ä·¹ÀÌÅÍ ¸»Àä +4 Á¤ÀçÇå 08-31 2877
104  ÀÌÁ÷À» ÇÏ·Á°í ÇÕ´Ï´Ù. +6 ¹ÚÂù¿ì 08-27 4345
 1  2  3  4  5  6  7  8  9  10  11  12  
 
 
 
Copyright ¨Ï wwwold.androidstudy.co.kr. All rights reserved.