![]() |
ɽ¶«ÊÖ»ú±¨
º£±¨ÐÂÎÅ
¹«¹²Íø¹Ù·½Î¢ÐÅ
¹«¹²Íø¹Ù·½Î¢²©
¶¶Òô
ÈËÃñºÅ
È«¹úµ³Ã½Æ½Ì¨
ÑëÊÓƵ
°Ù¼ÒºÅ
¿ìÊÖ
Í·ÌõºÅ
ßÙÁ¨ßÙÁ¨
ÉîÛÚÐÂÎÅÍø
¸êçâÃ÷
ÊÖ»ú¼ì²ì
¥Þ¥ó¥·¥ç¥ó¤Ï¡¢¶¼»á²¿¤Ë¶à¤¯±£´æ¤¹¤ë±Êֱסլ¤Ç¤¹¡£¥Þ¥ó¥·¥ç¥ó¤Ë¤Ï¡¢ScrollView¤äRecyclerView¤Ê¤É¤Î¥Ó¥å©`¤¬º¬¤Þ¤ì¡¢¥æ©`¥¶©`¤¬¥¤¥ó¥¿¥é¥¯¥Æ¥£¥Ö¤Ë²Ù×÷¤Ç¤¤ë¤è¤¦¤ËÔOÓ‹¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¥Þ¥ó¥·¥ç¥ó¤Î viewType ¤Ï¡¢¤µ¤Þ¤¶¤Þ¤Ê¥ì¥¤¥¢¥¦¥È¤ò¥µ¥Ý©`¥È¤·¤Þ¤¹¡£
¥Þ¥ó¥·¥ç¥ó¤ÎlayoutInflater¤Ï¡¢¥ì¥¤¥¢¥¦¥È¶¨Áx¤«¤é¥Ó¥å©`¤ò¥¤¥ó¥Õ¥ì¥¤¥È¤·¤Þ¤¹¡£¥Þ¥ó¥·¥ç¥ó¤Î inflater ¤òʹÓ乤ë¤È¡¢XML ¥ì¥¤¥¢¥¦¥È¥Õ¥¡¥¤¥ë¤«¤é¥Ó¥å©`ëAŒÓ¤òÉú³É¤Ç¤¤Þ¤¹¡£¥Þ¥ó¥·¥ç¥ó¤ÎRecyclerView¤Ï¡¢ ListView ¤ò’ˆˆ¤·¤¿¤â¤Î¤Ç¡¢¥¹¥ï¥¤¥×ertype¤äGridLayoutManager¤Ê¤É¶àÖÖLayoutManager¤ËŒê¤·¤Æ¤¤¤Þ¤¹¡£
¥Þ¥ó¥·¥ç¥ó¤Î onCreateViewHolder ¥á¥½¥Ã¥É¤Ï¡¢ ViewHolder ¤ò×÷³É¤·¤Þ¤¹¡£¥Þ¥ó¥·¥ç¥ó¤ÎViewHolder ¤Ï¡¢RecyclerView¤ÎÄÚ²¿Ô”¼š¤òÖÎÀí¤·¤Þ¤¹¡£¥Þ¥ó¥·¥ç¥ó¤Î onBindViewHolder ¥á¥½¥Ã¥É¤Ï¡¢ ViewHolder ¤ò¸üФ¹¤ë¤¿¤á¤ËʹÓ䵤ì¤Þ¤¹¡£¥Þ¥ó¥·¥ç¥ó¤Î getItemCount ¥á¥½¥Ã¥É¤Ï¡¢¥Ç©`¥¿¤Îí—Ä¿Êý¤ò·µ¤·¤Þ¤¹¡£
¥Þ¥ó¥·¥ç¥ó¤Î ViewHolder ¤Ï¡¢ RecyclerView ÓäÎÔÙÀûÓÿÉÄܤʥӥå©` ¥³¥ó¥Æ¥Ê¤Ç¤¹¡£¥Þ¥ó¥·¥ç¥ó¤Î ViewHolder ¤Ï¡¢ onBindViewHolder ¤Ë¤è¤Ã¤Æ¸üФµ¤ì¤Þ¤¹¡£¥Þ¥ó¥·¥ç¥ó¤Î onCreateViewHolder ¤Ï¡¢ ViewHolder ¤ò×÷³É¤·¤Þ¤¹¡£
¥Þ¥ó¥·¥ç¥ó¤Î onCreateViewHolder ¥á¥½¥Ã¥É¤Ï¡¢LayoutInflater ¤òʹÓ䷤ƥӥå©`¤òÉú³É¤·¤Þ¤¹¡£¥Þ¥ó¥·¥ç¥ó¤Î onCreateViewHolder ¤Ï¡¢ itemView ¤ò·µ¤·¤Þ¤¹¡£¥Þ¥ó¥·¥ç¥ó¤Î onCreateViewHolder ¤Ï¡¢ ViewHolder ¤È itemView ¤ò·µ¤·¤Þ¤¹¡£
¥Þ¥ó¥·¥ç¥ó¤Î onCreateViewHolder ¤Ï¡¢ LayoutInflater ¤òʹÓä·¤Þ¤¹¡£¥Þ¥ó¥·¥ç¥ó¤Î.LayoutInflater ¤Ï¡¢ XML ¤«¤é¥Ó¥å©`¤òÉú³É¤·¤Þ¤¹¡£¥Þ¥ó¥·¥ç¥ó¤Î onCreateViewHolder ¤Ï¡¢ viewHolder ¤ò×÷³É¤·¤Þ¤¹¡£
¥Þ¥ó¥·¥ç¥ó¤Î onCreateViewHolder ¤Ï¡¢ kitti ¤ò×÷³É¤·¤Þ¤¹¡£¥Þ¥ó¥·¥ç¥ó¤Î viewHolder ¤Ï¡¢ RecyclerView ÓäǤ¹¡£¥Þ¥ó¥·¥ç¥ó¤Î onCreateViewHolder ¤Ï¡¢ viewHolder ¤ò·µ¤·¤Þ¤¹¡£
Copyright (C) 2001- dzwww.com. All Rights Reserved
ÐÂÎÅÐÅϢЧÀÍÐí¿ÉÖ¤ - ÒôÏñÖÆÆ·³öÊéÐí¿ÉÖ¤ - ¹ã²¥µçÊÓ½ÚÄ¿ÖÆ×÷¾ÓªÐí¿ÉÖ¤ - ÍøÂçÊÓÌýÐí¿ÉÖ¤ - ÍøÂçÎÄ»¯¾ÓªÐí¿ÉÖ¤
ɽ¶«Ê¡»¥ÁªÍø´«Ã½¼¯ÍÅÖ÷°ì ÁªÏµµç»°£º**2 Î¥·¨²»Á¼ÐÅÏ¢¾Ù±¨µç»°£º**0
Copyright (C) 2001- Dzwww ³ICP±¸09023866ºÅ-1