¾ÛÅøÁî
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°Ç
   
Listview ¿¡¼­ item visible ÇÒ¶§ ºó°ø°£À» ³ª¸ÓÁö itemÀ¸·Î ¸Å²Ü¼ö ¾ø³ª¿ä?
±Û¾´ÀÌ : ¼ÕÁø½Ä                   ³¯Â¥ : 2012-07-20 (±Ý) 10:10 Á¶È¸ : 5097
Á¦°¡ ±¸Çö ÇÒ·Á°í ÇÏ´Â Æ®¸® ¸ð¾çÀº
 
 
 Ã³À½ Ãâ·Â µ¥ÀÌÅÍ
 
 
¿ø ÇÏ´Â °á°ú(TreeItem02 Ŭ¸¯½Ã)
 
 
Ãâ·ÂµÇ´Â °á°ú(TreeItem02 Ŭ¸¯½Ã)
 
 
----------
TreeItem01
TreeItem02
TreeItem03
-----------
 
 
----------
TreeItem01
TreeItem03
-----------
 
 
----------
TreeItem01
 (ºó °ø°£)
TreeItem03
-----------
 
 
À§¿Í °°Àº °á°ú¸¦ ¾ò°í ½ÍÀºµ¥,
¾îÁ¦ ÇÏ·çÁ¾ÀÏ °í¹ÎÀÌÇÏ´Ù °á±¹ ÀÌ·¸°Ô ¿Ã¸®³×¿ä.¤Ð¤Ð
¼Ò½º´Â ¾Æ·¡¿Í °°½À´Ï´Ù.
Á¶¾ð, Ãæ°í, Á¤º¸ ¸ðµçÁö ȯ¿µÀÔ´Ï´Ù..¤Ð¤Ð µµ¿ÍÁֽʼî¤Ð¤Ð
 
public class C09_ListIconText extends Activity {
    ArrayList<MyItem> arItem;
 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.c09_listview);
        arItem = new ArrayList<MyItem>();
        MyItem mi;
        mi = new MyItem(R.drawable.icon, "»ï¼º ³ëÆ®ºÏ");  arItem.add(mi);
        mi = new MyItem(R.drawable.icon, "LG ¼¼Å¹±â");  arItem.add(mi);
        mi = new MyItem(R.drawable.icon, "´ë¿ì ¸¶Æ¼Áî"); arItem.add(mi);
        
        MyListAdapter MyAdapter = new MyListAdapter(this, R.layout.c09_icontext, arItem);
        ListView MyList;
        MyList=(ListView)findViewById(R.id.list);
        MyList.setAdapter(MyAdapter);
        MyList.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                String mes;
                mes = "Select Item = " + arItem.get(position).Name;
                Toast.makeText(C09_ListIconText.this, mes,Toast.LENGTH_SHORT).show();
    
                 parent.getChildAt(position).setVisibility(View.GONE);
            }
        });
    }
}
//¸®½ºÆ® ºä¿¡ Ãâ·ÂÇÒ Ç׸ñ
class MyItem {
    MyItem(int aIcon, String aName) {
        Icon = aIcon;
        Name = aName;
    }
    int Icon;
    String Name;
}
//¾î´ðÅÍ Å¬·¡½º
class MyListAdapter extends BaseAdapter {
    Context maincon;
    LayoutInflater Inflater;
    ArrayList<MyItem> arSrc;
    int layout;
    public MyListAdapter(Context context, int alayout, ArrayList<MyItem> aarSrc) {
        maincon = context;
        Inflater = (LayoutInflater)context.getSystemServic(Context.LAYOUT_INFLATER_SERVICE);
        arSrc = aarSrc;
        layout = alayout;
    }
    public int getCount() {
        return arSrc.size();
    }
    public String getItem(int position) {
        return arSrc.get(position).Name;
    }
    public long getItemId(int position) {
        return position;
    }
 // °¢ Ç׸ñÀÇ ºä »ý¼º
    public View getView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = Inflater.inflate(layout, parent, false);
        }
        ImageView img = (ImageView)convertView.findViewById(R.id.img);
        img.setImageResource(arSrc.get(position).Icon);
        TextView txt = (TextView)convertView.findViewById(R.id.text);
        txt.setText(arSrc.get(position).Name);
        return convertView;
    }
}
* ±ÛÀ» µî·ÏÇϽǶ§ ²À ÇÊ¿äÇÑ °æ¿ì°¡ ¾Æ´Ï¸é °³ÀÎÁ¤º¸¸¦ ³²±âÁö ¸¶¼¼¿ä ^^ (¿¬¶ôó,À̸ÞÀÏÁÖ¼Ò,Áֹεî·Ï¹øÈ£ µî)




¼ÕÁø½Ä ´ÔÀÇ Q&A ÃÖ½Å±Û [´õº¸±â]


 
±èº´ÁÖ 2012-11-23 (±Ý) 15:05
ListViewÀÇ ¾îµªÅÍ¿¡¼­´Â °¢ ¿¤¸®¸ÕÆ®µé¿¡ ´ëÇÑ LayoutÀ» ÅëÁ¦ÇÏ´Â ±â´ÉÀ» °¡Áø
getView()¶ó´Â °ÍÀÌ ÀÖ½À´Ï´Ù.
ÀÌ°÷¿¡¼­ Ŭ¸¯À̺¥Æ®¸¦ ¸ÔÀÌ°í, ÇØ´ç ¾ÆÀÌÅÛÀ» ¼ÂÆÃÇÏ½Ã¸é µÉ°Å °°½À´Ï´Ù.
 
±èº´ÁÖ 2012-11-23 (±Ý) 15:06
±×¸®°í Ãß°¡·Î, API_Demos¸¦ º¸¸é, collapsed¶ó´Â ¹æ¹ýÀ» Á¦¾ÈÇÏ°í ÀÖ½À´Ï´Ù.
Âü°íÇÏ½Ã¸é µÉ°Å °°±º¿ä.
   

°Ô½Ã¹° 223°Ç
¹øÈ£ Á¦¸ñ ±Û¾´ÀÌ ³¯Â¥ Á¶È¸
203  Intent »ç¿ë°ü·Ã Áú¹®ÀÔ´Ï´Ù. +2 ±èÁø 11-22 3164
202  ½º¸¶Æ®Æù¸¸¿¡¼­ µ¹¾Æ°¡´Â °ÔÀÓÀ» ÅÇ¿¡¼­µµ µ¹¾Æ°¡°Ô ÇÏ´Â ¹æ¹ý ¾Ë·ÁÁÖ¼¼¿ä ~ +2 Áö³ª 11-16 3099
201  ¾×ƼºñƼ°£ µ¥ÀÌÅÍÀü´Þ Áú¹®ÀÔ´Ï´Ù. +3 Á¤¿ëÇö 10-23 3130
200  SMS ¿À´Â ¹®ÀÚ¸¦ ¾Û¿¡¼­ ÀÚµ¿À¸·Î ¾Ë¾ÆÂ÷¸®´Â°Ç ¹¹ÁÒ? ¾È±æȯ 10-08 2
199  ºÎ»ê ¾Û°³¹ß ½ºÅ͵ð 11±â ¸ðÁýÀº ¾ðÁ¦ ½ÃÀÛÇϳª¿ä? +1 ¼­¹«´ö 09-17 3073
198  Ã³À½ °¡ÀÔÇغ¾´Ï´Ù. +1 °í¹ü¼® 09-07 3282
197  IAP °üÇؼ­? ÀÌÀ翵 09-07 4503
196  ÇÁ·¹ÀÓ ¾Ö´Ï¸ÞÀÌ¼Ç Áú¹®ÀÔ´Ï´Ù. ±èÈÆÀÏ 09-02 4186
195  ÀÌŬ¸³½º¿¡¼­ ÇÁ·ÎÁ§Æ® »ý¼ºÇÒ¶§ xml ÆÄÀÏÀÇ ±âº»¼³Á¤À» ¹Ù²Ü¼ö ÀÖ³ª¿ä? ±èÇö¹Î 08-28 3052
194  radio button Áú¹®ÀÔ´Ï´Ù. +1 ±èÈÆÀÏ 08-26 3810
193  ºÎ»ê ´ÙÀ½ ½ºÅ͵ð 11±â´Â ¾ðÁ¦Âë?? ¾È³çÇϼ¼¿ä! ¿À´Ã °¡ÀÔÇÏ¿´½À´Ï´Ù. +4 ÃÖ¿µÁø 08-23 2698
192  ÀÌŬ¸³½º ¿¡·¯ Áú¹®ÀÔ´Ï´Ù ¤Ì +1 Á¶ÀçÇö 08-22 4014
191  ±¸±Û Áöµµ Áú¹®ÀÌ¿ä ~ +4 ±è¹®¿í 08-14 4175
190  ¾Èµå·ÎÀÌµå °³¹ßÀÚºÐµé ¤Ð¤ÐÁ¶±Ý¸¸ µµ¿ÍÁÖ¼¼¿ä~¤Ð +2 Á¶ÀçÇö 08-10 4449
189  ¼ôÄÆ Áú¹®ÀÔ´Ï´Ù. +1 ±èº´ÁÖ 07-25 4891
188  ¾Èµå·ÎÀ̵忡¼­ À¯Åõºê µ¿¿µ»ó Àç»ý ÇÒ ¼ö ÀÖ´Â Á¦´ë·Î µÈ Äڵ带 ¾Ë·ÁÁֽøé.... +2 ¹®Àå¿ø 07-20 6040
187  Listview ¿¡¼­ item visible ÇÒ¶§ ºó°ø°£À» ³ª¸ÓÁö itemÀ¸·Î ¸Å²Ü¼ö ¾ø³ª¿ä? +2 ¼ÕÁø½Ä 07-20 5098
186  AutoCompleteTextView(ÀÚµ¿¿Ï¼º ÅؽºÆ®ºä) ¸¸µé±â Áú¹®ÀÌ¿ä ±è¹®¿í 07-19 4514
185  À¯Åõºê µ¿¿µ»ó ¸µÅ© Àç»ý °ú°ü·ÃÇؼ­ °í¼ö´Ôµé²² Áú¹®µå¸³´Ï´Ù.µµ¿ÍÁÖ¼¼¿ä..¤Ð¤Ð ¹®Àå¿ø 07-18 4670
184  xml ³»¿ëÀ» ¹Þ¾Æ¼­ Ž»ö±âó·³ Æ®¸®ÇüÅ·Π»Ñ·ÁÁÖ°í ½Í½À´Ï´Ù. ¼ÕÁø½Ä 07-17 4179
 1  2  3  4  5  6  7  8  9  10  11  12  
 
 
 
Copyright ¨Ï wwwold.androidstudy.co.kr. All rights reserved.