210 lines
7.1 KiB
Objective-C
Executable File
210 lines
7.1 KiB
Objective-C
Executable File
//
|
||
// BRPickerStyle.h
|
||
// BRPickerViewDemo
|
||
//
|
||
// Created by 任波 on 2019/10/2.
|
||
// Copyright © 2019年 91renb. All rights reserved.
|
||
//
|
||
// 最新代码下载地址:https://github.com/91renb/BRPickerView
|
||
|
||
#import <Foundation/Foundation.h>
|
||
#import <UIKit/UIKit.h>
|
||
#import "BRPickerViewMacro.h"
|
||
|
||
// 边框样式(左边取消按钮/右边确定按钮)
|
||
typedef NS_ENUM(NSUInteger, BRBorderStyle) {
|
||
/** 无边框(默认) */
|
||
BRBorderStyleNone = 0,
|
||
/** 有圆角和边框 */
|
||
BRBorderStyleSolid,
|
||
/** 仅有圆角 */
|
||
BRBorderStyleFill
|
||
};
|
||
|
||
@interface BRPickerStyle : NSObject
|
||
|
||
/////////////////////////////// 选中行颜色,不是框架的,是自己定义的 ///////////////////////////////
|
||
|
||
/** 设置选中行颜色(selectedColor)*/
|
||
@property (nonatomic, strong) UIColor *selectedColor;
|
||
|
||
/////////////////////////////// 蒙层视图(maskView)///////////////////////////////
|
||
|
||
/** 设置背景颜色(backgroundColor)*/
|
||
@property (nonatomic, strong) UIColor *maskColor;
|
||
|
||
/** 隐藏 maskView,默认为 NO */
|
||
@property (nonatomic, assign) BOOL hiddenMaskView;
|
||
|
||
|
||
////////////////////////////// 弹框视图(alertView)///////////////////////////////
|
||
|
||
/** 设置 alertView 弹框视图的背景颜色(backgroundColor)*/
|
||
@property (nonatomic, strong) UIColor *alertViewColor;
|
||
|
||
/** 设置 alertView 弹框视图左上和右上的圆角半径 */
|
||
@property (nonatomic, assign) NSInteger topCornerRadius;
|
||
|
||
/** 设置 alertView 弹框视图顶部边框线颜色 */
|
||
@property (nonatomic, strong) UIColor *shadowLineColor;
|
||
|
||
/** 隐藏 alertView 弹框视图顶部边框线,默认为 NO */
|
||
@property (nonatomic, assign) BOOL hiddenShadowLine;
|
||
|
||
|
||
//////////////////////////// 标题栏视图(titleBarView) ////////////////////////////
|
||
|
||
/** 设置 titleBarView 标题栏的背景颜色(backgroundColor)*/
|
||
@property (nonatomic, strong) UIColor *titleBarColor;
|
||
|
||
/** 设置 titleBarView 标题栏的高度(height)*/
|
||
@property (nonatomic, assign) CGFloat titleBarHeight;
|
||
|
||
/** 设置 titleBarView 标题栏底部分割线颜色 */
|
||
@property (nonatomic, strong) UIColor *titleLineColor;
|
||
|
||
/** 隐藏 titleBarView 标题栏底部分割线,默认为 NO */
|
||
@property (nonatomic, assign) BOOL hiddenTitleLine;
|
||
|
||
/** 隐藏 titleBarView,默认为 NO */
|
||
@property (nonatomic, assign) BOOL hiddenTitleBarView;
|
||
|
||
|
||
////////////////////////// 标题栏中间label(titleLabel)///////////////////////////
|
||
|
||
/** 设置 titleLabel 的背景颜色(backgroundColor)*/
|
||
@property (nonatomic, strong) UIColor *titleLabelColor;
|
||
|
||
/** 设置 titleLabel 文本颜色(textColor)*/
|
||
@property (nonatomic, strong) UIColor *titleTextColor;
|
||
|
||
/** 设置 titleLabel 字体大小(font)*/
|
||
@property (nonatomic, strong) UIFont *titleTextFont;
|
||
|
||
/** 设置 titleLabel 的 frame */
|
||
@property (nonatomic, assign) CGRect titleLabelFrame;
|
||
|
||
/** 隐藏 titleLabel,默认为 NO */
|
||
@property (nonatomic, assign) BOOL hiddenTitleLabel;
|
||
|
||
|
||
/////////////////////////////// 取消按钮(cancelBtn)//////////////////////////////
|
||
|
||
/** 设置 cancelBtn 的背景颜色(backgroundColor)*/
|
||
@property (nonatomic, strong) UIColor *cancelColor;
|
||
|
||
/** 设置 cancelBtn 标题的颜色(titleColor)*/
|
||
@property (nonatomic, strong) UIColor *cancelTextColor;
|
||
|
||
/** 设置 cancelBtn 标题的字体(font)*/
|
||
@property (nonatomic, strong) UIFont *cancelTextFont;
|
||
|
||
/** 设置 cancelBtn 的边框样式(borderStyle)*/
|
||
@property (nonatomic, assign) BRBorderStyle cancelBorderStyle;
|
||
|
||
/** 设置 cancelBtn 的 frame */
|
||
@property (nonatomic, assign) CGRect cancelBtnFrame;
|
||
|
||
/** 设置 cancelBtn 的 image */
|
||
@property (nonatomic, strong) UIImage *cancelBtnImage;
|
||
|
||
/** 设置 cancelBtn 的 title */
|
||
@property (nonatomic, copy) NSString *cancelBtnTitle;
|
||
|
||
/** 隐藏 cancelBtn,默认为 NO */
|
||
@property (nonatomic, assign) BOOL hiddenCancelBtn;
|
||
|
||
|
||
/////////////////////////////// 确定按钮(doneBtn)////////////////////////////////
|
||
|
||
/** 设置 doneBtn 的背景颜色(backgroundColor)*/
|
||
@property (nonatomic, strong) UIColor *doneColor;
|
||
|
||
/** 设置 doneBtn 标题的颜色(titleColor)*/
|
||
@property (nonatomic, strong) UIColor *doneTextColor;
|
||
|
||
/** 设置 doneBtn 标题的字体(font)*/
|
||
@property (nonatomic, strong) UIFont *doneTextFont;
|
||
|
||
/** 设置 doneBtn 的边框样式(borderStyle)*/
|
||
@property (nonatomic, assign) BRBorderStyle doneBorderStyle;
|
||
|
||
/** 设置 doneBtn 的 frame */
|
||
@property (nonatomic, assign) CGRect doneBtnFrame;
|
||
|
||
/** 设置 doneBtn 的 image */
|
||
@property (nonatomic, strong) UIImage *doneBtnImage;
|
||
|
||
/** 设置 doneBtn 的 title */
|
||
@property (nonatomic, copy) NSString *doneBtnTitle;
|
||
|
||
/** 隐藏 doneBtn,默认为 NO */
|
||
@property (nonatomic, assign) BOOL hiddenDoneBtn;
|
||
|
||
|
||
/////////////////////////////// 选择器(pickerView)///////////////////////////////
|
||
|
||
/** 设置 picker 的背景颜色(backgroundColor)*/
|
||
@property (nonatomic, strong) UIColor *pickerColor;
|
||
|
||
/** 设置 picker 中间两条分割线的背景颜色(separatorColor)*/
|
||
@property (nonatomic, strong) UIColor *separatorColor;
|
||
|
||
/** 设置 picker 文本的颜色(textColor)*/
|
||
@property (nonatomic, strong) UIColor *pickerTextColor;
|
||
|
||
/** 设置 picker 文本的字体(font)*/
|
||
@property (nonatomic, strong) UIFont *pickerTextFont;
|
||
|
||
/** 设置 picker 的高度(height),系统默认高度为 216 */
|
||
@property (nonatomic, assign) CGFloat pickerHeight;
|
||
|
||
/** 设置 picker 的行高(rowHeight)*/
|
||
@property (nonatomic, assign) CGFloat rowHeight;
|
||
|
||
|
||
/**
|
||
* 设置语言(不设置或为nil时,将随系统的语言自动改变)
|
||
* language: zh-Hans(简体中文)、zh-Hant(繁体中文)、en(英语 )
|
||
*/
|
||
@property(nonatomic, copy) NSString *language;
|
||
|
||
|
||
/////// 日期选择器单位样式(showUnitType == BRShowUnitTypeSingleRow 时,生效)////////
|
||
|
||
/** 设置日期选择器单位文本的颜色(textColor)*/
|
||
@property (nonatomic, strong) UIColor *dateUnitTextColor;
|
||
|
||
/** 设置日期选择器单位文本的字体(font)*/
|
||
@property (nonatomic, strong) UIFont *dateUnitTextFont;
|
||
|
||
/** 设置日期选择器单位 label 的水平方向偏移量(offsetX)*/
|
||
@property (nonatomic, assign) CGFloat dateUnitOffsetX;
|
||
|
||
/** 设置日期选择器单位 label 的竖直方向偏移量(offsetY)*/
|
||
@property (nonatomic, assign) CGFloat dateUnitOffsetY;
|
||
|
||
/** 设置日期选择器单位是否与 选择器的列 水平居中对齐 */
|
||
@property (nonatomic, assign) BOOL horizontalCenter;
|
||
|
||
|
||
//////////////////////////////// 常用的几种模板样式 ////////////////////////////////
|
||
|
||
/// 模板样式1 - 取消/确定按钮圆角样式
|
||
/// @param themeColor 主题颜色
|
||
+ (instancetype)pickerStyleWithThemeColor:(UIColor *)themeColor;
|
||
|
||
/// 模板样式2 - 顶部圆角样式 + 完成按钮
|
||
/// @param doneTextColor 完成按钮标题的颜色
|
||
+ (instancetype)pickerStyleWithDoneTextColor:(UIColor *)doneTextColor;
|
||
|
||
/// 模板样式3 - 顶部圆角样式 + 图标按钮
|
||
/// @param doneBtnImage 完成按钮的 image
|
||
+ (instancetype)pickerStyleWithDoneBtnImage:(UIImage *)doneBtnImage;
|
||
|
||
/// 模板样式4 - 日期选择器单位顶部显示(showUnitType == BRShowUnitTypeSingleRow 时,可设置)
|
||
+ (instancetype)pickerStyleWithDateUnitOnTop;
|
||
|
||
|
||
@end
|