Skip to content

Idtk/FigureImageView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
idtk
May 10, 2019
902acce · May 10, 2019

History

22 Commits
May 30, 2016
Jun 3, 2016
May 30, 2016
May 30, 2016
Jun 2, 2016
May 10, 2019

Repository files navigation

FigureImageView

Introduction

    本类继承自ImageView,可以用于设置图片的形状,现有圆角、圆形、扇形、环形,四种可选方式。 可以通过set或者xml来设置圆角的半径,以及扇形、环形样式的角度。

Version

    SdkVersion >= 19

Usage

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:tools="http://schemas.android.com/tools"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              xmlns:app="http://schemas.android.com/apk/res-auto"
              android:paddingBottom="@dimen/activity_vertical_margin"
              android:paddingLeft="@dimen/activity_horizontal_margin"
              android:paddingRight="@dimen/activity_horizontal_margin"
              android:paddingTop="@dimen/activity_vertical_margin"
              tools:context="com.example.administrator.customview.MainActivity"
              android:orientation="vertical"
              android:layout_gravity="center"
              android:gravity="center"
    >
    <com.example.administrator.customview.FigureImageView
        android:src="@mipmap/image1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        app:mode="circle"
        />
    <com.example.administrator.customview.FigureImageView
        android:src="@mipmap/image1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        app:mode="round_rect"
        app:radius="30dp"/>
    <com.example.administrator.customview.FigureImageView
        android:src="@mipmap/image1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        app:mode="sector"
        app:angle="-120"/>
    <com.example.administrator.customview.FigureImageView
        android:src="@mipmap/image1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        app:mode="ring"
        app:angle="-120"/>
</LinearLayout>

FigureImageView


More

<attr name="length" format="dimension"/>
public void setLength(float length) {
    this.length = length;
}

可用于设置显示图片区域的大小

About

博客:www.idtkm.com
GitHub:https://github.com/Idtk
邮箱:IdtkMa@gmail.com

About

多种样式的图片

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages