spstore / spalertcontroller Goto Github PK
View Code? Open in Web Editor NEW提醒对话框,风格和微信原生几乎零误差。简书地址:
Home Page: https://www.jianshu.com/p/f55b98c352a7
License: MIT License
提醒对话框,风格和微信原生几乎零误差。简书地址:
Home Page: https://www.jianshu.com/p/f55b98c352a7
License: MIT License
新版本不设置title不会弹出,demo测试可以,放到项目就不行了,新版本不知道为什么不行,换回老版本就可以了,
没有更新背景中的对话框大小.导致背景出现一块透明内容
必现
重现方式:
弹出alert框 宽度哪里能修改,希望宽度跟系统的宽度一样
调试发现此时alertController的view高度为0,导致各子view都无法显示出来。
SPAlertController *alertController = [SPAlertController alertControllerWithTitle:nil message:nil preferredStyle:SPAlertControllerStyleActionSheet];
alertController.needDialogBlur = YES;
SPAlertAction *actionQuit = [SPAlertAction actionWithTitle:CMString(@"自己", nil) style:SPAlertActionStyleDefault handler:^(SPAlertAction * _Nonnull action) {
}];
[alertController addAction:actionQuit];
SPAlertAction *actionKill = [SPAlertAction actionWithTitle:CMString(@"他人", nil) style:SPAlertActionStyleDestructive handler:^(SPAlertAction * _Nonnull action) {
}];
[alertController addAction:actionKill];
SPAlertAction *actionCancel = [SPAlertAction actionWithTitle:CMString(@"取消", nil) style:SPAlertActionStyleCancel handler:^(SPAlertAction * _Nonnull action) {
}];
[alertController addAction:actionCancel];
[self presentViewController:alertController animated:YES completion:^{}];
message文字较多的化,alert的小标题显示有问题,scrollew可滑动
ios13上设置自定义view宽度展示出来的不对,例如我设置屏幕宽-32 可左右间距还是很大
Trapped uncaught exception 'NSGenericException', reason: 'Unable to install constraint on view. Does the constraint reference something from outside the subtree of the view? That's illegal. constraint:<NSLayoutConstraint:0x1c029d650 UIView:0x1076ebcc0.width == 414> view:<UITransitionView: 0x112c66cf0; frame = (0 0; 414 736); autoresize = W+H; layer = <CALayer: 0x1c04380c0>>'
(
0 CoreFoundation 0x000000018376e37c <redacted> + 148
1 libobjc.A.dylib 0x00000001829b4528 objc_exception_throw + 56
2 CoreFoundation 0x000000018376e2ac <redacted> + 0
3 Foundation 0x00000001840ab9a0 <redacted> + 236
4 UIKit 0x000000018cd3725c <redacted> + 488
5 UIKit 0x000000018cd37038 <redacted> + 36
6 UIKit 0x000000018cd40134 <redacted> + 176
7 Foundation 0x00000001840ab4dc <redacted> + 168
8 UIKit 0x000000018cd3fffc <redacted> + 164
9 ******* 0x0000000104f88b98 -[SPAlertPresentationController updateConstraints] + 7648
10 ******* 0x0000000104f86708 -[SPAlertPresentationController containerViewWillLayoutSubviews] + 200
11 UIKit 0x000000018cc4ce38 <redacted> + 1076
12 QuartzCore 0x00000001877b1998 <redacted> + 184
13 QuartzCore 0x00000001877b5b20 <redacted> + 332
14 QuartzCore 0x000000018772236c <redacted> + 336
15 QuartzCore 0x0000000187749b90 <redacted> + 540
16 UIKit 0x000000018cc425c8 <redacted> + 256
17 CoreFoundation 0x0000000183715edc <redacted> + 32
18 CoreFoundation 0x0000000183713894 <redacted> + 412
19 CoreFoundation 0x0000000183713e50 <redacted> + 1292
20 CoreFoundation 0x0000000183633e58 CFRunLoopRunSpecific + 436
21 GraphicsServices 0x00000001854e0f84 GSEventRunModal + 100
22 UIKit 0x000000018ccb367c UIApplicationMain + 236
23 ******* 0x0000000104c0f658 main + 184
24 libdyld.dylib 0x000000018315056c <redacted> + 4
)
如题 不敢上线用啊 我需要提供什么环境给大佬复现啊
能用marsonry 约束重新布局一下就更好了
Hope to support
delay个0.5秒之后present就可以,但是系统的UIAlertViewController则没这个bug,本想用这个库替换整个项目里面的原生alert,但是很多地方都在didLoad里面做的弹窗。。。
问题描述.zip
👆以上是问题描述。
SPAlertController *alertController = [SPAlertController alertControllerWithTitle:nil
message:nil
preferredStyle:SPAlertControllerStyleActionSheet];
SPAlertAction *contact = [SPAlertAction actionWithTitle:ASLocalized(@"解除绑定")
style:SPAlertActionStyleDefault
handler:^(SPAlertAction * _Nonnull action) {
NSLog(@"无效");
}];
SPAlertAction *cacel = [SPAlertAction actionWithTitle:ASLocalized(@"取消") style:SPAlertActionStyleDefault handler:nil];
[alertController addAction:contact];
[alertController addAction:cacel];
// 设置对话框不需要毛玻璃
alertController.needDialogBlur = NO;
[self presentViewController:alertController animated:YES completion:nil];
IQKeyboardManager 自定义view的时候,Field还是被挡住
你是全部封装在.m里面 ,我拿不到。runtime只能拿第一层:
Ivar ivar = class_getInstanceVariable([SPAlertController class], "_headerView");//必须是下划线接属性
UIView *view = object_getIvar(self.spaVC, ivar);
view.backgroundColor = kRedColor;
但是我要改按钮背景色怎么做?不想把pod的东西提出来改,最大限度尊重原作者。
delay个0.5秒之后present就可以,但是系统的UIAlertViewController则没这个bug,本想用这个库替换整个项目里面的原生alert,但是很多地方都在didLoad里面做的弹窗。。。
为啥SPAlertAnimationTypeFromTop和SPAlertAnimationTypeFromRight的时候点击背景无法响应dismiss的事件?
/** 是否单击背景退出对话框,默认为YES */
@Property(nonatomic, assign) BOOL tapBackgroundViewDismiss;
这个属性根本没有用啊 设置了都是无效的 什么时候麻烦完善下
因为我看微信的cancel按钮在iPhone X上是将底部全部包含进去的,跟您demo的样式不太一致,请教在哪里修改cancel的高度啊
我项目中的sheet样式类似于系统自带的样式,就是左右两边有20的间距,然后带一点圆角,如果我想要类似于这样的效果,不知道怎么设置呢?
大佬,请支持下横屏模式,谢谢!!!
很好用的库,希望能够兼容到IOS8或者IOS8.2?
你是有什么地方,使用到ios9的类么
你好,我想控制 SPAlertAction的image大小要怎么做?
点击高亮效果没有,希望作者改进下
Message文字过多,就变成scrollview滚动,如何设置弹框的高度啊
想改下,源码在哪里能改这个高度呀?
SPAlertController *alertController = [SPAlertController alertControllerWithTitle:@"111" message:@"111" preferredStyle:SPAlertControllerStyleAlert animationType:SPAlertAnimationTypeExpand];
alertController.textAlignment = NSTextAlignmentLeft;
[self presentViewController:alertController animated:YES completion:^{}];
这里如果修改为alertController.modalPresentationStyle = UIModalPresentationFullScreen;
背景会变为白的,并且点击不会消失。
请问这个应该怎么修改
SPAlertController *alertController = [SPAlertController alertControllerWithTitle:@"请选择变更的场景,变更后报警规则将重置" message:@"subtile" preferredStyle:SPAlertControllerStyleActionSheet animationType:SPAlertAnimationTypeFromBottom];
SPAlertAction *new = [SPAlertAction actionWithTitle:@"+ 新建场景" style:SPAlertActionStyleDestructive handler:^(SPAlertAction * _Nonnull action) {
NSLog(@"点击了 新建场景");
}];
SPAlertAction *cancel = [SPAlertAction actionWithTitle:@"取消" style:SPAlertActionStyleCancel handler:^(SPAlertAction * _Nonnull action) {
NSLog(@"点击了Cancel");
}];
[alertController addAction:new];
[alertController addAction:cancel];
[alertController setBackgroundViewAppearanceStyle:appearanceStyle alpha:0.5];
ActionView 背景是否可以不透明
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.