longitachi / ZLPhotoBrowser

Wechat-like image picker. Support select photos, videos, gif and livePhoto. Support edit image and crop video. 微信样式的图片选择器,支持预览/相册内拍照及录视频、拖拽/滑动选择,编辑图片/视频,支持多语言国际化等功能;

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

希望支持修改 btnSelect 颜色 / 样式

Arabaku opened this issue · comments

4.4.6 版本开始支持设置选择按钮上是否显示序列号,同时 btnSelect 给了默认的选中样式。希望可以在 ZLPhotoUIConfiguration 中给出对其进行修改的方法。
image

commented

修改序号字体颜色及背景色

/// The text color of selected cell index label.
/// 已选照片右上角序号label背景色
public var indexLabelTextColor: UIColor = .zl.rgba(220, 220, 220)
private var pri_indexLabelBgColor: UIColor?
/// The background color of selected cell index label.
/// 已选照片右上角序号label背景色
public var indexLabelBgColor: UIColor {
get {
pri_indexLabelBgColor ?? (showIndexOnSelectBtn ? themeColor : .clear)
}
set {
pri_indexLabelBgColor = newValue
}
}

修改选择按钮图片参照这个

/// Developers can customize images, but the name of the custom image resource must be consistent with the image name in the replaced bundle.
/// - example: Developers need to replace the selected and unselected image resources, and the array that needs to be passed in is
/// ["zl_btn_selected", "zl_btn_unselected"].
public var customImageNames: [String] = [] {
didSet {
ZLCustomImageDeploy.imageNames = customImageNames
}
}
/// Developers can customize images, but the name of the custom image resource must be consistent with the image name in the replaced bundle.
/// - example: Developers need to replace the selected and unselected image resources, and the array that needs to be passed in is
/// ["zl_btn_selected": selectedImage, "zl_btn_unselected": unselectedImage].
public var customImageForKey: [String: UIImage?] = [:] {
didSet {
customImageForKey.forEach { ZLCustomImageDeploy.imageForKey[$0.key] = $0.value }
}
}

非常感谢!