android 自定义圆形pop,Android布局自定义Shap圆形ImageView可以单独设置背景与图片...
一、圖片預(yù)覽:
一、實(shí)現(xiàn)功能:
需求要實(shí)現(xiàn)布局中為圓形圖片,圖片背景與圖標(biāo)分開(kāi)且合并到一個(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代碼如下:
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如下:
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel="false">
android:height="50dp"/>
通過(guò)以上內(nèi)容給大家介紹了Android布局自定義Shap圓形ImageView可以單獨(dú)設(shè)置背景與圖片的相關(guān)知識(shí),希望對(duì)大家今后的工作學(xué)習(xí)有所幫助。
總結(jié)
以上是生活随笔為你收集整理的android 自定义圆形pop,Android布局自定义Shap圆形ImageView可以单独设置背景与图片...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Vue第一部分(5):计算属性和过滤器
- 下一篇: [11] ADB 实用功能