Closed Nododo closed 2 years ago
或者说 如果自定义视图为第一个视图,顶部距离默认为0
你看这样呢?
LEEAlert
.alert
.config
.LeeClickBackgroundClose(YES)
.LeeBackGroundColor(UIColor.redColor)
.LeeHeaderInsets(UIEdgeInsetsZero)
.LeeAddCustomView(^(LEECustomView * _Nonnull custom) {
custom.view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth - Scale(80), Scale(80))];
custom.view.backgroundColor = kRandomColor;
})
.LeeItemInsets(UIEdgeInsetsZero)
.LeeAddCustomView(^(LEECustomView * _Nonnull custom) {
custom.view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth - Scale(200), Scale(80))];
custom.view.backgroundColor = kRandomColor;
})
.LeeItemInsets(UIEdgeInsetsZero)
.LeeAddAction(^(LEEAction * _Nonnull action) {
action.title = @"兑换积分";
action.cornerRadius = Scale(8);
action.borderWidth = 1;
action.borderColor = kRandomColor;
action.insets = UIEdgeInsetsMake(20, 20, 20, 20);
action.borderPosition = LEEActionBorderPositionTop
| LEEActionBorderPositionBottom
| LEEActionBorderPositionLeft
| LEEActionBorderPositionRight;
})
.LeeAddAction(^(LEEAction * _Nonnull action) {
action.title = @"水晶兑换";
action.cornerRadius = Scale(8);
action.backgroundColor = kRandomColor;
action.insets = UIEdgeInsetsMake(20, 20, 20, 20);
})
.LeeShow();
你看这样呢?
LEEAlert .alert .config .LeeClickBackgroundClose(YES) .LeeBackGroundColor(UIColor.redColor) .LeeHeaderInsets(UIEdgeInsetsZero) .LeeAddCustomView(^(LEECustomView * _Nonnull custom) { custom.view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth - Scale(80), Scale(80))]; custom.view.backgroundColor = kRandomColor; }) .LeeItemInsets(UIEdgeInsetsZero) .LeeAddCustomView(^(LEECustomView * _Nonnull custom) { custom.view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth - Scale(200), Scale(80))]; custom.view.backgroundColor = kRandomColor; }) .LeeItemInsets(UIEdgeInsetsZero) .LeeAddAction(^(LEEAction * _Nonnull action) { action.title = @"兑换积分"; action.cornerRadius = Scale(8); action.borderWidth = 1; action.borderColor = kRandomColor; action.insets = UIEdgeInsetsMake(20, 20, 20, 20); action.borderPosition = LEEActionBorderPositionTop | LEEActionBorderPositionBottom | LEEActionBorderPositionLeft | LEEActionBorderPositionRight; }) .LeeAddAction(^(LEEAction * _Nonnull action) { action.title = @"水晶兑换"; action.cornerRadius = Scale(8); action.backgroundColor = kRandomColor; action.insets = UIEdgeInsetsMake(20, 20, 20, 20); }) .LeeShow();
wow 可以的
看来我代码还是没吃透啊
谢谢啦!
. LeeItemInsets()
会影响它前面的Item
. LeeItemInsets()
会影响它前面的Item
嗯嗯
读过源码发下如果只添加customView,顶部留白问题为下面代码所致
item.insets = UIEdgeInsetsMake(5, 0, 5, 0);
这个属性能暴露出来支持自定义吗?
代码如下: