Comments (4)
No description provided.
嗯?是什么问题?支持的呀
from wmzdialog.
- (void)youkuDialog{
__weak CustomVC *WEAK = self;
myAlert = Dialog()
.wTypeSet(DialogTypeMyView)
//关闭事件 此时要置为不然会内存泄漏
.wEventCloseSet(^(id anyID, id otherData) {
myAlert = nil;
})
.wShowAnimationSet(AninatonZoomIn)
.wHideAnimationSet(AninatonZoomOut)
.wMyDiaLogViewSet(^UIView *(UIView *mainView) {
UIImageView *image = [UIImageView new];
image.image = [UIImage imageNamed:@"healthy"];
// image.frame = CGRectMake(0, 0, mainView.frame.size.width, 80);
[mainView addSubview:image];
[image mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.mas_equalTo(mainView);
make.size.mas_equalTo(CGSizeMake(mainView.frame.size.width, 80));
}];
UILabel *la = [UILabel new];
la.font = [UIFont systemFontOfSize:15.0f];
la.text = @"为呵护未成年人健康成长,优酷特别推出青少年模式,该模式下部分功能无法正常使用,请监护人主动选择,并设置监护密码";
la.numberOfLines = 0;
// la.frame = CGRectMake(10, CGRectGetMaxY(image.frame), mainView.frame.size.width-20, 100);
[mainView addSubview:la];
[la mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(mainView).offset(10);
make.top.mas_equalTo(image.mas_bottom);
make.size.mas_equalTo(CGSizeMake(mainView.frame.size.width-20, 100));
}];
UIButton *enter = [UIButton buttonWithType:UIButtonTypeCustom];
[mainView addSubview:enter];
enter.titleLabel.font = [UIFont systemFontOfSize:14.0f];
// enter.frame = CGRectMake(0, CGRectGetMaxY(la.frame), mainView.frame.size.width, 44);
[enter setTitle:@"进入青少年模式 >" forState:UIControlStateNormal];
[enter setTitleColor:DialogColor(0x108ee9) forState:UIControlStateNormal];
[enter addTarget:WEAK action:@selector(youkuAction:) forControlEvents:UIControlEventTouchUpInside];
[enter mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(mainView);
make.top.mas_equalTo(la.mas_bottom);
make.size.mas_equalTo(CGSizeMake(mainView.frame.size.width, 44));
}];
UIButton *know = [UIButton buttonWithType:UIButtonTypeCustom];
[mainView addSubview:know];
know.titleLabel.font = [UIFont systemFontOfSize:14.0f];
// know.frame = CGRectMake(0, CGRectGetMaxY(enter.frame), mainView.frame.size.width, 44);
[know setTitle:@"我知道了" forState:UIControlStateNormal];
[know setTitleColor:DialogColor(0x3333333) forState:UIControlStateNormal];
[know addTarget:WEAK action:@selector(youkuAction:) forControlEvents:UIControlEventTouchUpInside];
[know mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(mainView);
make.top.mas_equalTo(enter.mas_bottom);
make.size.mas_equalTo(CGSizeMake(mainView.frame.size.width, 44));
}];
mainView.layer.masksToBounds = YES;
mainView.layer.cornerRadius = 10;
return know;
})
.wStart();
}
![1101597988897_ pic](https://user-images.githubusercontent.com/23187644/90857243-49353c00-e3b6-11ea-8b1c-ff994109c6e6.jpg)
显示不全,高度不对,我试着改了下demo里的会显示成这样
from wmzdialog.
//自定义优酷方法
- (void)youkuDialog{
__weak CustomVC *WEAK = self;
myAlert = Dialog()
.wTypeSet(DialogTypeMyView)
//关闭事件 此时要置为不然会内存泄漏
.wEventCloseSet(^(id anyID, id otherData) {
myAlert = nil;
})
.wShowAnimationSet(AninatonZoomIn)
.wHideAnimationSet(AninatonZoomOut)
.wMyDiaLogViewSet(^UIView *(UIView *mainView) {
UIImageView *image = [UIImageView new];
image.image = [UIImage imageNamed:@"healthy"];
// image.frame = CGRectMake(0, 0, mainView.frame.size.width, 80);
[mainView addSubview:image];
[image mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.mas_equalTo(mainView);
make.size.mas_equalTo(CGSizeMake(mainView.frame.size.width, 80));
}];UILabel *la = [UILabel new]; la.font = [UIFont systemFontOfSize:15.0f]; la.text = @"为呵护未成年人健康成长,优酷特别推出青少年模式,该模式下部分功能无法正常使用,请监护人主动选择,并设置监护密码"; la.numberOfLines = 0;
// la.frame = CGRectMake(10, CGRectGetMaxY(image.frame), mainView.frame.size.width-20, 100);
[mainView addSubview:la];
[la mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(mainView).offset(10);
make.top.mas_equalTo(image.mas_bottom);
make.size.mas_equalTo(CGSizeMake(mainView.frame.size.width-20, 100));
}];UIButton *enter = [UIButton buttonWithType:UIButtonTypeCustom]; [mainView addSubview:enter]; enter.titleLabel.font = [UIFont systemFontOfSize:14.0f];
// enter.frame = CGRectMake(0, CGRectGetMaxY(la.frame), mainView.frame.size.width, 44);
[enter setTitle:@"进入青少年模式 >" forState:UIControlStateNormal];
[enter setTitleColor:DialogColor(0x108ee9) forState:UIControlStateNormal];
[enter addTarget:WEAK action:@selector(youkuAction:) forControlEvents:UIControlEventTouchUpInside];
[enter mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(mainView);
make.top.mas_equalTo(la.mas_bottom);
make.size.mas_equalTo(CGSizeMake(mainView.frame.size.width, 44));
}];UIButton *know = [UIButton buttonWithType:UIButtonTypeCustom]; [mainView addSubview:know]; know.titleLabel.font = [UIFont systemFontOfSize:14.0f];
// know.frame = CGRectMake(0, CGRectGetMaxY(enter.frame), mainView.frame.size.width, 44);
[know setTitle:@"我知道了" forState:UIControlStateNormal];
[know setTitleColor:DialogColor(0x3333333) forState:UIControlStateNormal];
[know addTarget:WEAK action:@selector(youkuAction:) forControlEvents:UIControlEventTouchUpInside];
[know mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(mainView);
make.top.mas_equalTo(enter.mas_bottom);
make.size.mas_equalTo(CGSizeMake(mainView.frame.size.width, 44));
}];mainView.layer.masksToBounds = YES; mainView.layer.cornerRadius = 10; return know; }) .wStart();
}
可以加下q群代码发我看看~ ~ 这想复制过去都难 937909825
from wmzdialog.
此问题的 最后面调用一下[mainView layoutIfNeeded] 即可
from wmzdialog.
Related Issues (20)
- 日期选择希望增加一个几点到几点的选择 HOT 2
- 富文本设置了setLineSpacing 计算高度问题! HOT 2
- format格式为HH:mm时wMinDateSet无效
- DialogTypeDatePicker HOT 1
- looks so smart
- 请问如何修改弹窗的背景颜色呢? HOT 5
- 请问如何修改弹窗圆角的大小呢? HOT 2
- DialogTypeSheet,无法多行显示吗? HOT 9
- [feature]Please support Carthage HOT 1
- 请问如何修改,点击后的高亮颜色 ,现在是黄色 HOT 3
- 当 wTypeSet(DialogTypeDatePicker) 时候如何设置文字不要这种凹凸的对齐方式? HOT 4
- 日历设置了默认日期没效果;设置了最小日期和最大最小值效果一直左滑后再右滑发现title日期不对 HOT 1
- 使用DialogTypePop和DialogPopTypeCustom类型的时候tableview的cell的右边会多出10px的像素的空白内容 HOT 4
- 提个小需求:能否增加设置语言 HOT 4
- 日历为多选时,能不能设置最多选择个数?比如可以多选2个、3个、5个等。
- 关于日历的想法及问题
- 获取农历日期崩溃`- (BOOL)updateDateYear:(NSInteger)year Month:(NSInteger)month index:(NSInteger)index`出错导致
- 自定义弹窗
- 自定义View实现了WMZCustomPrototol HOT 1
- 支持OC吗? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wmzdialog.