Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

两列情况下 列间距 #201

Open
Elephant-Jhon opened this issue Nov 6, 2020 · 4 comments
Open

两列情况下 列间距 #201

Elephant-Jhon opened this issue Nov 6, 2020 · 4 comments

Comments

@Elephant-Jhon
Copy link

你好 请问两列之间的列间距可以控制嘛
image

@agiapp
Copy link
Owner

agiapp commented Nov 6, 2020

默认不支持的,每列滚轮等分宽度

@Elephant-Jhon
Copy link
Author

默认不支持的,每列滚轮等分宽度
请问如果要实现间距的话我怎么调比较好

@agiapp
Copy link
Owner

agiapp commented Nov 6, 2020

有一种方法是减小整个宽度来缩小两列之间的距离,不知道符不符合你的需求。

1.效果

image

2.参考代码

// 创建选择器容器视图(可以自定义弹框视图,把 containerView 放到自定义的弹框视图上)
UIView *containerView = [[UIView alloc]initWithFrame:CGRectMake((self.view.bounds.size.width - 150) / 2, 170, 150, 300)];
containerView.backgroundColor = BR_RGB_HEX(0xf2f2f7, 1.0f);
[customAlertView addSubview:containerView];

// 创建日期选择器
BRDatePickerView *datePickerView = [[BRDatePickerView alloc]init];
datePickerView.pickerMode = BRDatePickerModeMD;
datePickerView.showUnitType = BRShowUnitTypeOnlyCenter;
datePickerView.resultBlock = ^(NSDate *selectDate, NSString *selectValue) {
    
};

// 自定义选择器主题样式
BRPickerStyle *customStyle = [[BRPickerStyle alloc]init];
customStyle.pickerColor = containerView.backgroundColor;
datePickerView.pickerStyle = customStyle;

// 添加选择器到容器视图
[datePickerView addPickerToView:containerView];

@Liyongcong
Copy link

同问有没有更好的方案可以控制列间距,这个需求应该还是挺常见的,并且是否可以设置缩放比例,最后一行是日感觉太扁了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants