First, picture preview:
First, realize the function:
Requirements to implement a circular picture in the layout, the picture background is separated from the icon and merged into a imageview.
Second, the concrete realization:
XML layout in the definition of ImageView, the key to set two parameters Android:backgroup (set background), ANDROID:SRC (set ImageView in the picture), the circle picture production drawable under the definition of XML Shap style ( Solid-color,size-width\hight)
The XML code is as follows:
<imageview
android:id= "@+id/zhongjie"
android:layout_width= "wrap_content"
android:layout_height = "Wrap_content"
android:background= "@drawable/popwindow_zhongjie"
android:scaletype= "Centerinside"
drawable-style XML is as follows:
<?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>
Through the above content to introduce the Android layout of the custom Shap circular ImageView can be set up a separate background and pictures of the relevant knowledge, I hope that the future work of everyone to help.