赠人玫瑰,手有余香!本人学习经验分享,共勉!
本讲内容:Button 按钮
Button,EditText,CheckBox,等常用组件都是TextView的直接子类或间接子类
按钮是程序中最常见的一个元素,我们通过一个例子感受一下,代码的讲解都写在注释里了,所以我就直接上代码和代码的运行结果。
下面是布局文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.text.MainActivity$PlaceholderFragment" >
<TextView
android:id="@+id/textViewId"
android:layout_widt