WHRoundedImageView 是一个简单方便的 swift 组件,它扩展了 UIImageView。它允许您在 Interface Builder 中直接为图像添加半径和边框。
实时预览完全支持。
通过CocoaPods提供RoundImageView,只需将其引用添加到您的Podfile中
pod 'WHRoundedImageView'
您可以直接将 WHRoundedImageView.swift
拷贝到您的项目中。
WHRoundedImageView
,然后像使用常规的 UIImageView 一样使用它。radiusRatio
默认值:0.0(0.5 = 正方形图像的完全圆角)borderWidth
默认值:0.0borderColor
默认值:blackColorWei He [email protected]