¾ÛÅøÁî
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 Á¶È¸ : 5098
Á¦°¡ ±¸Çö ÇÒ·Á°í ÇÏ´Â Æ®¸® ¸ð¾çÀº
 
 
 Ã³À½ Ãâ·Â µ¥ÀÌÅÍ
 
 
¿ø ÇÏ´Â °á°ú(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°Ç
¹øÈ£ Á¦¸ñ ±Û¾´ÀÌ ³¯Â¥ Á¶È¸
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.