本文實例為大家分享了android Matrix圖片隨意放大縮小和拖動的具體代碼,供大家參考,具體內(nèi)容如下
step1:新建一個項目DragAndZoom,并準備一張照片放在res/drawable-hdpi目錄下,如下圖所示:
step2: 設(shè)置應(yīng)用的UI界面,在main.xml中設(shè)置:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageView android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@drawable/wall" android:id="@+id/imageView" android:scaleType="matrix" /> <!-- 指定為matrix類型 --> </LinearLayout>
網(wǎng)站欄目:androidMatrix實現(xiàn)圖片隨意放大縮小或拖動-創(chuàng)新互聯(lián)
轉(zhuǎn)載來于:http://www.rwnh.cn/article44/dspshe.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站建設(shè)、網(wǎng)站營銷、手機網(wǎng)站建設(shè)、云服務(wù)器、網(wǎng)站設(shè)計公司、服務(wù)器托管
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容