亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Android布局自定義Shap圓形ImageView可以單獨(dú)設(shè)置背景與圖片

 更新時(shí)間:2016年01月11日 10:26:48   投稿:mrr  
這篇文章主要介紹了Android布局自定義Shap圓形ImageView可以單獨(dú)設(shè)置背景與圖片 的相關(guān)資料,需要的朋友可以參考下

一、圖片預(yù)覽:

一、實(shí)現(xiàn)功能:

需求要實(shí)現(xiàn)布局中為圓形圖片,圖片背景與圖標(biāo)分開且合并到一個(gè)ImageView。

二、具體實(shí)現(xiàn):

XML中布局中定義ImageView,關(guān)健設(shè)置兩個(gè)參數(shù) Android:backgroup(設(shè)置背景),Android:src(設(shè)置ImageVIew中圖片),圓形圖片制作Drawable下定義xml shap樣式(solid-color,size-width\hight)

XML代碼如下:

<ImageView
android:id="@+id/zhongjie"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/popwindow_zhongjie"
android:scaleType="centerInside"
android:src="@drawable/mark_caller_house_agent" /> 

Drawable-樣式xml如下:

<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel="false">
<solid android:color="#66CC00"/>
<size android:width="50dp"
android:height="50dp"/>
</shape>

通過以上內(nèi)容給大家介紹了Android布局自定義Shap圓形ImageView可以單獨(dú)設(shè)置背景與圖片的相關(guān)知識,希望對大家今后的工作學(xué)習(xí)有所幫助。

相關(guān)文章

最新評論