目的: 在文字編輯方塊中輸入內容, 按下按鈕後取得剛才輸入的內容並顯示在另一個TextView上

image

image

image

image

image

image

定義字串: Resources介面編輯或是手動編輯strings.xml

image

   1: <?xml version="1.0" encoding="utf-8"?>
   2: <resources>
   3:  
   4:     <string name="app_name">ButtonClickEvent</string>
   5:     <string name="action_settings">Settings</string>
   6:     <string name="hello_world">Hello world!</string>
   7:     <string name="input_your_name">輸入你的姓名</string>
   8:     <string name="display_input_info">顯示輸入資訊</string>
   9:     <string name="input_name_is">輸入的資訊是</string>
  10:     
  11: </resources>

layout設計如下:

image

宣告三個變數showView, edit, btn

image

模擬器執行

image

Padfone2 64GB 執行

Screenshot_2014-02-03-02-17-52

範例程式: ButtonClickEvent

arrow
arrow
    全站熱搜

    me1237guy 發表在 痞客邦 留言(0) 人氣()