目标:掌握ImageBotton的使用
java.lang.Object | |||
↳ | android.view.View | ||
↳ | android.widget.ImageView | ||
↳ | android.widget.ImageButton |
Button类是TextView类的子类,表示文本的扩充。
ImageButton是ImageView的子类,表示对图片的扩充。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageButton
android:id="@+id/rig"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/right" />
<ImageButton
android:id="@+id/wro"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/wrong" />
</LinearLayout>
这个类的目的是:1.TextView 和Button 的关系==ImageView和ImageButton的关系