android 提示資訊

來源:互聯網
上載者:User
android 的常標籤和方法 android 初學者
    部落格分類: 

  • Android
AndroidBlog

大家還是去:http://rubyrails.iteye.com/blog/289967

他那邊的代碼有排板過.

 

按鈕:

Xml代碼  
  1. <Button android:id="@+id/jump"  
  2.     android:layout_width="fill_parent"  
  3.     android:layout_height="wrap_content"  
  4.     android:text="button to"  
  5.     />  

 

 

顯示文本

 

Xml代碼  
  1. <TextView android:id="@+id/result"  
  2.     android:layout_width="fill_parent"  
  3.     android:layout_height="wrap_content"  
  4.     android:text=""  
  5.     />  

 

編輯框:

 

Xml代碼  
  1. <EditText android:id="@+id/height"  
  2.     android:layout_width="fill_parent"  
  3.     android:layout_height="wrap_content"  
  4.     android:numeric="integer"  
  5.     android:text=""  
  6.     />  

 

 

支援多行:

Xml代碼  
  1. <EditText id="@+id/Text1"  
  2. android:layout_width="200sp"  
  3. android:layout_height="24sp"  
  4. android:text="Text1"  
  5. android:singleLine="True"  
  6. />  
  7. <EditText id="@+id/text3"  
  8. android:layout_width="180px"  
  9. android:layout_height="80px"  
  10. android:text="Text3 width='180px' android:singleLine='False'"  
  11. android:singleLine="False"  
  12. />  

 

 

 

 多看協助文檔

 

兩種小提示信看

    Java代碼  
    1. 第一種:  
    2.   
    3.  Toast.makeText(Calculator.this, "The buttonface was 1.", Toast.LENGTH_SHORT).show();  
    4.   
    5. 第二種  
    6.   
    7.  private void openOptionsDialog() {  
    8.      new AlertDialog.Builder(this)  
    9.      .setTitle("weight / (height * height) is :" + BMI)  
    10.      .setMessage("Android BMI Calc")  
    11.      .show();  
    12.  }  
    13.   
    14.    openOptionsDialog();  

    聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.