android recylcerView應用drag swipe 取得連結 Facebook X Pinterest 以電子郵件傳送 其他應用程式 3月 17, 2019 建立ItemTouchHelper 並設定 itemTouchHelper.attachToRecyclerView(recyclerView); 取得連結 Facebook X Pinterest 以電子郵件傳送 其他應用程式 留言
html css & bootstrap心得 7月 16, 2019 html心得: block and inline elements Lists link and attributes tables forms css心得: selectors layout: box model: display:block display:inline display:inline-block visibility:hidden display:none box-sizing:border-box positioning: position:relative position:absolute position:fixed float: float:left selectors::after clear:both bootstrap心得: 引用代碼直接官網複製 Layout Flexbox: display: flex; class="d-flex flex-row" class="d-flex justify-content-center" class="d-flex align-items-center" Containers and grid system Media Queries: 有條件的發生 @media (min-width: 480px) { body { background-color: yellow; } } Containers Grid System Justification Navbar and Scrollspy Cards and Card Layout modal彈跳視窗 閱讀完整內容
android AsyncTask的executeOnExecutor 4月 16, 2019 AsyncTask的兩個用法 execute跟executeOnExecutor 第一個是按照使用的順序執行 第二個則是可以並行 imgDownload.execute(thumbnail); imgDownload.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, thumbnail); 閱讀完整內容
Android 影像記憶體管理心得 2月 21, 2019 Android App很容易發生記憶體過量的問題,這個時候如何釋放不用的記憶體成為一門學問,但這篇心得不會講到如何釋放記憶體。 App在讀取大量圖片的情況很容易造成記憶體過量的問題,實際測試在新專案裡面,在xml設定一個ImageView,設定一張原圖大約為300kb的png的圖,居然吃掉了約10mb的記憶體空間,由於Android在讀取的時候是用Bitmap來讀圖,檔案大小會根據原圖的解析度。 所以一個頁面若是有很多圖片,開開關關就很容易造成記憶體過量。在xml定義縮圖也是沒有意義的,只會縮放大小。 (ps:兩個ImageView使用一樣的圖,並不會造成記憶體兩倍。) 這邊提供一個小心得是,在定義xml的時候,都使用同一張圖來定義ImageView,當作是預覽用,讓他佔一個空間以調整大小與距離。 之後在程式執行的時候,首先將圖全部以bitmap的方式讀進來,在一個個view設定圖片,這樣就能夠對bitmap進行真正意義的縮放,還有記憶體的釋放也容易。 閱讀完整內容
留言
張貼留言