Android程序设计学习笔记
Exercise: create a temperature converter
- create new project
- create new attributes, like color, string and so on. xml position is res/values/XXX.xml
- create the layout. Remove the old layout. Afterwards add a LinearLayout with one EditText as child, afterwards add a RadioGroup with two radio buttons and a button to your layout.
- we can use attributes we add at step 2 to decorate the views.
- set android:onClick property for button.
有三种方法可以添加按钮的按钮事件和响应,一种就是通过xml, 一种通过设置监听的方法。还有一种还不理解。
网友评论