1 / 19

Android Programming

Android Programming. 圖片相關介面元件. 教材. 文淵閣工作室( 2013 ), Android 初學特訓班(第三版), 碁峰資訊股份有限公司, ISBN 9789862767986 (書號 ACL035132 ) 朱桂英( 2013 ), Android 開發應用-基礎篇 ( 第二版 ) , 上奇資訊股份有限公司, ISBN 9789862577288 (書號 HR1306 )

Download Presentation

Android Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Android Programming 圖片相關介面元件

  2. 教材 文淵閣工作室(2013), Android 初學特訓班(第三版), 碁峰資訊股份有限公司, ISBN 9789862767986 (書號 ACL035132) 朱桂英(2013), Android 開發應用-基礎篇 (第二版), 上奇資訊股份有限公司, ISBN 9789862577288 (書號 HR1306) 彭亦暄、陳彥文(2013), Android 應用程式開發與設計實務, 博碩文化股份有限公司, ISBN 978-986-201-762-3 (書號 PG31312)

  3. 大綱 ImageView 介面元件 Gallery 介面元件 繼承 BaseAdapter 影片循環的 Gallery GridView 介面元件

  4. ImageView 介面元件 • void android.widget.ImageView.setImageResource(intresId) • ImageView介面元件主要用以顯示影像,讓顯示畫面更加美觀和生動。 • 設定影像資源

  5. 範例:影像播放器 利用 ImageView顯示影像,並可以 上一張、下一張 按鈕顯示其他的影像。

  6. Gallery 畫廊展示 展示方式:將圖片由左至右擺放 支援手指左右拖曳滑動 可以選取指定的圖片

  7. Gallery 畫廊展示

  8. Gallery 程式執行流程

  9. 繼承 BaseAdapter • Gallery 元件的資料來源必須建立一個繼承自 BaseAdapter的物件 • 放置圖片資料 • 實作 getCount()、getItem()、getItemId()、getView() • getView() 顯示圖片

  10. 範例:以 Gallery 元件顯示圖片

  11. GridView 介面元件—表格展示 • 在表格中放置圖片進行展示 • 設定每一列的欄數,圖片展示時依欄自動折行

  12. GridView常用屬性

  13. GridView 程式執行流程

  14. 範例:GridView 顯示圖片

More Related