一、圖片預覽:

一、實現功能:
需求要實現布局中為圓形圖片,圖片背景與圖標分開且合並到一個ImageView。
二、具體實現:
XML中布局中定義ImageView,關健設置兩個參數 Android:backgroup(設置背景),Android:src(設置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>
