Android常用技巧編寫方式總結(jié)
作者:佚名
在這篇文章中為大家總結(jié)的Android常用技巧都包括有按鈕的實現(xiàn);文本的顯示技巧;編輯框的實現(xiàn);以及支持多行的功能等等。
在Android模擬器中對這一操作系統(tǒng)進行編寫,大多數(shù)人都會總結(jié)出自己的一套方式技巧,來提高編寫速度。我們在這里為大家總結(jié)了幾個常用功能的實現(xiàn)技巧,希望能夠給大家在實際編程中帶來一些幫助。
Android常用技巧之按鈕:
Xml代碼
- < Button android:id="@+id/jump"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="button to"
- />
- < Button android:id="@+id/jump"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="button to"
- />
Android常用技巧之顯示文本
Xml代碼
- < TextView android:id="@+id/result"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text=""
- />
- < TextView android:id="@+id/result"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text=""
- />
Android常用技巧之編輯框:
Xml代碼
- < EditText android:id="@+id/height"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:numeric="integer"
- android:text=""
- />
- < EditText android:id="@+id/height"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:numeric="integer"
- android:text=""
- />
Android常用技巧之支持多行:
Xml代碼
- < EditText id="@+id/Text1"
- android:layout_width="200sp"
- android:layout_height="24sp"
- android:text="Text1"
- android:singleLine="True"
- />
- < EditText id="@+id/text3"
- android:layout_width="180px"
- android:layout_height="80px"
- android:text="Text3 width='180px'
android:singleLine='False'"- android:singleLine="False"
- />
- < EditText id="@+id/Text1"
- android:layout_width="200sp"
- android:layout_height="24sp"
- android:text="Text1"
- android:singleLine="True"
- />
- < EditText id="@+id/text3"
- android:layout_width="180px"
- android:layout_height="80px"
- android:text="Text3 width='180px'
android:singleLine='False'"- android:singleLine="False"
- />
Android常用技巧的一些實際操作方法就為大家介紹到這里。
【編輯推薦】
責任編輯:曹凱
來源:
javaeye.com