編輯電子書 - ListView高段設計
書名:
型號:
價格:
簡介:
效率是ListView/ListActivity程式實作上最常發現的問題,如何讓使用者能很順暢的滑動列表資訊並且手機記憶體資源仍能保持充足以得到良好的使用體驗,這無疑是一個不斷持續精進的工作。 在自訂適配器實作BaseAdapter類別的過程中最大的瓶頸就是getView()方法的調用,要知道每一次使用者滾動ListView列表容器裡的列表項目時適配器的getView()方法就必須調用一次,以便將最新的資訊顯示給使用者。 每當為了顯示新的列表資訊,很自然地會將相關創建View物件實體的程式碼寫在getView()方法中,但當項目增多時這無疑是對手機資源消耗的最大傷害,所以必須要想如何暫存已經創建過的View物件實體,等需要時不是再重新創建新的View物件實體,而是直接提取之前已暫存的資訊,提高資源重複使用與再利用性。 那要暫存在哪?getTag()/setTag()這個每個View物件都有的標籤方法將是一個很好的解決之道。 點圖觀看大圖 資料布局流程 點圖觀看大圖
內容:
<div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> <div class="txt01" style="position: relative; left: 24px; width: 560px;"> <table style="table-layout:fixed; word-break:normal; word-wrap:break-word"> <tbody> <tr> <td>效率是ListView/ListActivity程式實作上最常發現的問題,如何讓使用者能很順暢的滑動列表資訊並且手機記憶體資源仍能保持充足以得到良好的使用體驗,這無疑是一個不斷持續精進的工作。</td> </tr> </tbody> </table> </div> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> <div class="txt01" style="position: relative; left: 24px; width: 560px;"> <table style="table-layout:fixed; word-break:normal; word-wrap:break-word"> <tbody> <tr> <td>在自訂適配器實作BaseAdapter類別的過程中最大的瓶頸就是getView()方法的調用,要知道每一次使用者滾動ListView列表容器裡的列表項目時適配器的getView()方法就必須調用一次,以便將最新的資訊顯示給使用者。</td> </tr> </tbody> </table> </div> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> <div class="txt01" style="position: relative; left: 24px; width: 560px;"> <table style="table-layout:fixed; word-break:normal; word-wrap:break-word"> <tbody> <tr> <td>每當為了顯示新的列表資訊,很自然地會將相關創建View物件實體的程式碼寫在getView()方法中,但當項目增多時這無疑是對手機資源消耗的最大傷害,所以必須要想如何暫存已經創建過的View物件實體,等需要時不是再重新創建新的View物件實體,而是直接提取之前已暫存的資訊,提高資源重複使用與再利用性。</td> </tr> </tbody> </table> </div> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> <div class="txt01" style="position: relative; left: 24px; width: 560px;"> <table style="table-layout:fixed; word-break:normal; word-wrap:break-word"> <tbody> <tr> <td>那要暫存在哪?getTag()/setTag()這個每個View物件都有的標籤方法將是一個很好的解決之道。</td> </tr> </tbody> </table> </div> </div> <div style="font-family: Arial, 新細明體; background-color: rgb(255, 255, 255);"> <table> <tbody> <tr> <td> <p> </p> </td> <td> <table align="center" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td><img src="http://www.pcschool.tv/scorm12/class/05187TC1/class800/05187tc1/05187tc1_m7_4/images/bor_l01.gif" style="height:13px; width:13px" /></td> <td><img src="http://www.pcschool.tv/scorm12/class/05187TC1/class800/05187tc1/05187tc1_m7_4/images/bor_t01.gif" style="height:13px; width:13px" /></td> <td><img src="http://www.pcschool.tv/scorm12/class/05187TC1/class800/05187tc1/05187tc1_m7_4/images/bor_l03.gif" style="height:13px; width:13px" /></td> </tr> <tr> <td><img src="http://www.pcschool.tv/scorm12/class/05187TC1/class800/05187tc1/05187tc1_m7_4/images/bor_t02.gif" style="height:13px; width:13px" /></td> <td><img id="img0" src="http://www.pcschool.tv/scorm12/class/05187TC1/class800/05187tc1/05187tc1_m7_4/images/1_4_1.jpg" style="cursor:pointer; height:319px; width:500px" title="點圖觀看大圖" /></td> <td> </td> </tr> <tr> <td><img src="http://www.pcschool.tv/scorm12/class/05187TC1/class800/05187tc1/05187tc1_m7_4/images/bor_l02.gif" style="height:13px; width:13px" /></td> <td><img src="http://www.pcschool.tv/scorm12/class/05187TC1/class800/05187tc1/05187tc1_m7_4/images/bor_t03.gif" style="height:13px; width:13px" /></td> <td><img src="http://www.pcschool.tv/scorm12/class/05187TC1/class800/05187tc1/05187tc1_m7_4/images/bor_l04.gif" style="height:13px; width:13px" /></td> </tr> </tbody> </table> </td> </tr> <tr> <td> <p> </p> </td> </tr> </tbody> </table> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> </div> <div class="txt03" style="font-size: 15px; color: rgb(160, 44, 152); line-height: 22px; font-family: Arial, 新細明體; background-color: rgb(255, 255, 255);">資料布局流程</div> <div style="font-family: Arial, 新細明體; background-color: rgb(255, 255, 255);"> <table> <tbody> <tr> <td> <p> </p> </td> <td> <table align="center" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td><img src="http://www.pcschool.tv/scorm12/class/05187TC1/class800/05187tc1/05187tc1_m7_4/images/bor_l01.gif" style="height:13px; width:13px" /></td> <td><img src="http://www.pcschool.tv/scorm12/class/05187TC1/class800/05187tc1/05187tc1_m7_4/images/bor_t01.gif" style="height:13px; width:13px" /></td> <td><img src="http://www.pcschool.tv/scorm12/class/05187TC1/class800/05187tc1/05187tc1_m7_4/images/bor_l03.gif" style="height:13px; width:13px" /></td> </tr> <tr> <td><img src="http://www.pcschool.tv/scorm12/class/05187TC1/class800/05187tc1/05187tc1_m7_4/images/bor_t02.gif" style="height:13px; width:13px" /></td> <td><img id="img1" src="http://www.pcschool.tv/scorm12/class/05187TC1/class800/05187tc1/05187tc1_m7_4/images/1_4_2.jpg" style="cursor:pointer; height:183px; width:500px" title="點圖觀看大圖" /></td> <td> </td> </tr> <tr> <td><img src="http://www.pcschool.tv/scorm12/class/05187TC1/class800/05187tc1/05187tc1_m7_4/images/bor_l02.gif" style="height:13px; width:13px" /></td> <td><img src="http://www.pcschool.tv/scorm12/class/05187TC1/class800/05187tc1/05187tc1_m7_4/images/bor_t03.gif" style="height:13px; width:13px" /></td> <td><img src="http://www.pcschool.tv/scorm12/class/05187TC1/class800/05187tc1/05187tc1_m7_4/images/bor_l04.gif" style="height:13px; width:13px" /></td> </tr> </tbody> </table> </td> </tr> <tr> <td> <p> </p> </td> </tr> </tbody> </table> </div>
上架
封面圖:
當前封面:
支援格式: JPG, PNG, GIF (最大 2MB)
更新電子書
返回列表