日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

AndroidUI的组成部分RoomButton

發(fā)布時(shí)間:2025/6/17 45 豆豆
生活随笔 收集整理的這篇文章主要介紹了 AndroidUI的组成部分RoomButton 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
<!-- 知識點(diǎn)匯總:1、Button與ImageButton的差別在于,Button生成的button上顯示文字 而ImageButton上則顯示圖片。須要指出的是:為ImageButton按 鈕指定 android:text屬性沒用(ImageButton的本質(zhì)是ImageView),即使指定 了該屬性。圖片button上也不會顯示不論什么文字 2、ImageButton 派生了一個(gè)ZoomButton ,ZoomButton能夠代表“放大”、 "縮小"兩個(gè)button。

ZoomButton的行為基本相似于Imagebutton,僅僅是 Android默認(rèn)提供了btn_minus、btn_plus兩個(gè)Drawable資源,僅僅要為 ZoomButton的android:src屬性分別指定btn_minus、btn_plus。就可以實(shí)現(xiàn) "放大",“縮小”button 3、Android中還提供了一個(gè)ZoomControls組件,該組件相當(dāng)于同一時(shí)候組合了 “放大”、“縮小”兩個(gè)button,并同意分別為兩個(gè)button綁定不同的事件 --> <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" > <!-- 普通圖片button --> <ImageButton android:layout_width="80dp" android:layout_height="80dp" android:src="@drawable/blue" /> <!-- 按下時(shí)顯示不同圖片的button --> <ImageButton android:layout_width="80dp" android:layout_height="80dp" android:src="@drawable/button_selector" /> <LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="10sp" android:layout_gravity="center_horizontal" > <!-- 分別定義2個(gè)ZoomButton,并分別似乎用btn_minus和btn_plus圖片 --> <ZoomButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/btn_zoom_down" android:src="@android:drawable/btn_minus" /> <ZoomButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/btn_zoom_up" android:src="@android:drawable/btn_plus" /> </LinearLayout> <!-- 定義ZoomControls組件 --> <ZoomControls android:id="@+id/zoomControls1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" /> </LinearLayout>

顯示效果


轉(zhuǎn)載請注明出處:http://blog.csdn.net/android_jiangjun/article/details/25341727


轉(zhuǎn)載于:https://www.cnblogs.com/bhlsheji/p/4889853.html

總結(jié)

以上是生活随笔為你收集整理的AndroidUI的组成部分RoomButton的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。