日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Android >内容正文

Android

AndroidUI的组成部分RoomButton

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

ZoomButton的行為基本相似于Imagebutton,僅僅是 Android默認提供了btn_minus、btn_plus兩個Drawable資源,僅僅要為 ZoomButton的android:src屬性分別指定btn_minus、btn_plus。就可以實現 "放大",“縮小”button 3、Android中還提供了一個ZoomControls組件,該組件相當于同一時候組合了 “放大”、“縮小”兩個button,并同意分別為兩個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" /> <!-- 按下時顯示不同圖片的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個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>

顯示效果


轉載請注明出處:http://blog.csdn.net/android_jiangjun/article/details/25341727


轉載于:https://www.cnblogs.com/bhlsheji/p/4889853.html

總結

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

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。