android--widget介绍之ImageButton
在UI设计中,Button是一个常用控件,但是Button太普通,不够艺术化,和页面的其他元素不协调,这时,往往会希望用图片代替,ImageButton由此产生。
如下是一个完整的demo,包含了click事件处理
在UI设计中,Button是一个常用控件,但是Button太普通,不够艺术化,和页面的其他元素不协调,这时,往往会希望用图片代替,ImageButton由此产生。
如下是一个完整的demo,包含了click事件处理
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="fill_parent"