編輯:關於 Android 開發
TextView 用於顯示文字,EditText 則用於讓使用者輸入文字。兩者是 Android 介面開發中最常見的基礎控制項。
常用屬性包括 id、layout_width、layout_height、text、textSize、textColor 與 background。layout_width 與 layout_height 可設定為 wrap_content 或 match_parent,以決定控制項尺寸。
hint 可顯示輸入提示;inputType 可指定輸入類型,例如文字、密碼、數字或電話號碼,藉此調整鍵盤與輸入行為。
在 activity_main.xml 中建立 TextView 與 EditText,並於 MainActivity 透過 setContentView 載入版面配置。
ButterKnife 8.1.0 的配置與使用,解決空指針問題
ButterKnife 8.1.0 的配置與使用,解決空指針問題ButterKnife 是這兩年比較流行的開源庫,是一個 View 注入框架,主要功能是代替 findVi
Android Studio 建立簽名金鑰並發布 APK
Android Studio 建立簽名金鑰並發布 APK 在 Android Studio 打包正式版本時,需要建立或指定 keystore。建立 New Key Sto
Android 5.0 Settings 原始碼分析:Dashboard 啟動流程
Android 5.0 Settings 原始碼分析:Dashboard 啟動流程 Android 5.0 的 Settings 與早期版本相比,首畫面不再以 Heade
Android 開發學習之路:用 Annotation 簡化 View 綁定
Android 開發學習之路:用 Annotation 簡化 View 綁定 在 Android Activity 中,反覆撰寫 setContentView 與 fin