¾È³çÇϼ¼¿ä ÃÊÂ¥ÀÔ´Ï´Ù...
ÇöÀç ´Þ·Â±¸ÇöÀ» ÇÏ°íÀÖ½À´Ï´Ù.
ÇÑ ¾×ƼºñƼ¿¡´Â Gridview·Î ´Þ·ÂÇ¥½Ã, ±× ¹Ø¿¡ Listview·Î ÀÏÁ¤Ç¥½Ã (DB Ãß°¡ÇÏ¿© Ç¥½ÃµÇ°Ô µÇ¾îÀÖ½À´Ï´Ù)
±×¸®°í ÇÑ ¾×ƼºñƼ¿¡´Â ´Þ·Â(Gridview)Ç¥½Ã¸¦ À§ÇÑ Custom Adapter°¡ ÀÖ±¸¿ä.
ÇöÀç Custom Adapter¿¡
¸¸¾à
{
ÀÏÁ¤ÀÌ Ãß°¡°¡ µÇ¾ú´Ù¸é (Listview¿¡ ÀÏÁ¤ÀÌ ÀÖ´Ù¸é)
GridviewÀÇ ÇØ´ç ³¯Â¥¿¡ ¾ÆÀÌÄÜ Ç¥½Ã (ImageView(¾ÆÀÌÄÜ))
}
¸¦ ±¸ÇöÇÏ·Á°í Çϴµ¥
±× Á¶°ÇÀ» DBÀÇ °ªÀÇ À¯¹«¿¡ µû¶ó Àâ¾Æ¾ßÇÒÁö
ListviewÀÇ °ªÀÇ À¯¹«¿¡ µû¶ó Àâ¾Æ¾ßÇÒÁö ¸ð¸£°Ú½À´Ï´Ù.
±×¸®°í Á¶°ÇÀ» ¾îµð ±âÁØÀ¸·Î Àâ¾Æ¾ßÇÒÁöµµ ¸·È÷°í ÀÖ³×¿ä ¤Ð¤Ð
ÇöÀç Á¦°¡ ½ÃµµÇغ» ÄÚµå´Â
SQLiteDatabase db = mDBHelper.getWritableDatabase();
cursor = db.rawQuery("SELECT * FROM today WHERE date = '" + curentDateString + "'", null);
cursor.moveToPosition(1);
ddd = cursor.getString(1);
ImageView iw2 = (ImageView) v.findViewById(R.id.date_icon2);
if ( ddd != "")
{
iw2.setVisibility(View.VISIBLE);
}else{
iw2.setVisibility(View.INVISIBLE);
}
ÀÔ´Ï´Ù.
AdapterÀÇ Getview ¾È¿¡ µé¾î°¡ ÀÖ±¸¿ä.
DB°ª À¯¹«¸¦ È®ÀÎÇÏ¿© Á¶°ÇÀ» ¿Ï¼ºÇÏ°í ½ÍÀºµ¥ Á¦°¡ ¹è¿îÁö ¾ó¸¶ ¾ÈµÇ¼ Àß ¸ð¸£°Ú½À´Ï´Ù. ±¸±Û¸µµµ ¸¹ÀÌ ÇßÁö¸¸ ã±â Èûµå³×¿ä..
Á¶±ÝÀ̳ª¸¶ µµ¿ò ºÎŹµå¸³´Ï´Ù! | |
|