android 的常標籤和方法 android 初學者
AndroidBlog
大家還是去:http://rubyrails.iteye.com/blog/289967
他那邊的代碼有排板過.
按鈕:
Xml代碼
- <Button android:id="@+id/jump"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="button to"
- />
顯示文本
Xml代碼
- <TextView android:id="@+id/result"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text=""
- />
編輯框:
Xml代碼
- <EditText android:id="@+id/height"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:numeric="integer"
- android:text=""
- />
支援多行:
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"
- />
多看協助文檔
兩種小提示信看
Java代碼
- 第一種:
-
- Toast.makeText(Calculator.this, "The buttonface was 1.", Toast.LENGTH_SHORT).show();
-
- 第二種
-
- private void openOptionsDialog() {
- new AlertDialog.Builder(this)
- .setTitle("weight / (height * height) is :" + BMI)
- .setMessage("Android BMI Calc")
- .show();
- }
-
- openOptionsDialog();