itofu / lcactionsheet Goto Github PK
View Code? Open in Web Editor NEW一款简约而不失强大的 ActionSheet,微博、微信和 QQ 都采用了极其类似的样式,完全支持 Swift。
Home Page: https://note.leodev.me/LCActionSheet/
License: MIT License
一款简约而不失强大的 ActionSheet,微博、微信和 QQ 都采用了极其类似的样式,完全支持 Swift。
Home Page: https://note.leodev.me/LCActionSheet/
License: MIT License
在 iPad 默认横屏下,依旧是从左边弹出,是否有相关的属性,可以设置从下往上的弹出。
现在有普通按钮、高亮按钮、取消按钮都不同颜色的需求。。
新版本强了很多...不过从v1过来的人表示很忧伤,完全不兼容,全部需要重新写...好尴尬,不清楚当时为什么没有升级上来,也没限制版本.
貌似无法单独设置cancle的样式,只能和其他样式一样
cancleButtonColor
cancleButtonFont
以及更加灵活的选中点击效果
添加个属性来初始化 titleLabel 的 numberOfLines .
类似微博的回复功能...因为我们没有限制回复字数...然后titleView特别高
如果为了改actionsheet,比如title,在http请求后,更改title,则需要持有actionsheet(即未销毁),由于新建的Uiwindow;则会锁住界面,就是界面点击无反应;
建议:
RT。
sheet的window会被键盘盖住
在
strongSelf.window.rootViewController = nil;
strongSelf.window.hidden = YES;
后面建议加上
strongSelf.window = nil;
也就是 redBtn 的文字颜色
[!] Error installing LCActionSheet
[!] /usr/bin/git clone https://github.com/iTofu/LCActionSheet.git /var/folders/jy/kcv5_tdd3zl8779ssc_2l1r40000gn/T/d20181113-43008-wutd4s --template= --single-branch --depth 1 --branch 3.5.0
Cloning into '/var/folders/jy/kcv5_tdd3zl8779ssc_2l1r40000gn/T/d20181113-43008-wutd4s'...
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
请问下,能否区分点击的是空白区域还是cancelButton
ActionSheet显示的时候,点击屏幕空白处,buttonidex返回0,不应该触发clicked啊,
1.2.3版本没有问题~
感谢作者提供的开源控件。thx
前提:当手指在按住 cell 的时候,cell 会进入 highlighted 状态;此时松开手指的话,则会响应 UITableView 的 delegate 的点击事件;但是如果手指稍微滑动一下再松开手指,则不会响应 UITableView 的 delegate 的点击事件,这是比较友好的一个细节,提供用户取消选择的机会。
因为禁止了 UITableView 的滑动事件,所以如果选择了其中某一行,则没办法取消选择了。不知道有什么办法解决没?
*** Checking out LCActionSheet at "3.5.0"
*** xcodebuild output can be found in /var/folders/9z/kqwr9s597_d5cz8z5dk038nm0000gn/T/carthage-xcodebuild.HZ3Q1w.log
*** Skipped building LCActionSheet due to the error:
Dependency "LCActionSheet" has no shared framework schemes
If you believe this to be an error, please file an issue with the maintainers at https://github.com/iTofu/LCActionSheet/issues/new
I found that "Cancel" button is always attributed with Chinese characters. What if we want to implement an international solution using LCActionSheet? At the present, I implemented it in this way:
- (NSString *)cancelText
{
if (_cancelText) {
return _cancelText;
}
_cancelText = NSLocalizedString(@"cancel", nil);
return _cancelText;
}
Thus, I suppose that it's better to provide a function for modifying the text of cancel button.
类似SVProgressHUD。
大多数项目为了达到视觉一致,都会统一进行设置的。
但是目前这样,每个实例设置一遍不仅冗余代码多,而且难以维护。
另:建议增加title contentInset设置,类似微信目前的title比较高,留白较多,看起来会更加大气。
当使用该项目弹出sheet之后。再使用keywindow发生很大的偏移。导致使用你的框架之后,就不能再操作视图的window了
#52
请针对上面的PR,发一个新版本可以吗?
问题严重,我这边等着上线
另外,一点小建议,与其单独放出具体的属性出来允许修改,不如直接把控件放出来,很多属性都可以修改了这样的话,比如下面这些
sheet.buttonFont
sheet.buttonColor
改为
sheet.XXXButton.XXX
因为在使用一些其他开源库的时候发现越来越多更新都倾向于使用这样的方式,比如MBProgressHud
因为item个数不定,太多时超出屏幕高度,能否提供api限定view最大高度占屏幕高度的比例
希望出个Swift版本
使用了一次,发现plus上使用cellLine出现未占满的情况;我觉得可以使用uiview,用backgroundcolor来弄;
以上只是建议
从2.5.2升级到最新版 点击LcactionSheet跳转到下一界面,下一界面的没有横过来,横屏布局变成了竖屏布局
有时候通过buttonIndex 来讨论容易出错 不易读
希望bottomView可以换成scrollview或者在bottomView上再放一个scrollview。
在appdelegate加入
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
在plist文件中
View controller-based status bar appearance设置为NO
把ViewController的背景色设置为灰色。就看的很清楚
LCActionSheet(
title: "取消关注后将不再得到关于此话题的更新信息",
cancelButtonTitle: "取消",
clicked: { actionSheet, index in
print(index)
},
otherButtonTitleArray: ["不再关注"]
)
.then {
$0.destructiveButtonIndexSet = Set<Int>(arrayLiteral: 1)
$0.blurEffectStyle = .light
}
.show()
这种方法并不能设置不再关注
为红色。是我设置的方式有问题吗?
还有就是能提供一个配置,旋转屏幕自动隐藏掉的功能吗?微信是这样做的
https://github.com/iTofu/LCActionSheet/blob/master/LCActionSheet/LCActionSheet.m#L215
这里生成了一次 UIVisualEffectView ,是不是多余的?
NSString *alertMsg = @"一个超级长的title一个超级长的title一个超级长的title一个超级长的title一个超级长的title一个超级长的title";
LCActionSheet *sheet = [[LCActionSheet alloc] initWithTitle:alertMsg
buttonTitles:@[@"确定"]
redButtonIndex:0
delegate:self];
NSArray *titles = @[@"你是大**", @"你是二货", @"你还是一个大吃货"];
LCActionSheet *actionSheet = [LCActionSheet sheetWithTitle:@"搜索" buttonTitles:titles redButtonIndex:1 clicked:^(NSInteger buttonIndex) {
NSLog(@"点击了%@",titles[buttonIndex]);
}];
[actionSheet show];
block方式获取不到按钮的标题
现在我有个需求,每个选项需要不同颜色,超过了3个(不超过3个,可以高亮,普通,取消)。支持这种自定义有必要吗?
我有些页面的status bar是黑色, 有些是白色, 在使用旧版本的时候没有影响,原本是什么颜色就是什么颜色, 但是新版本后变得很尴尬。。白色的状态栏在显示sheet后变成了黑色,点击后又变回白色。。你可能为了多种原因重构了代码, 但是我还是选择旧版本好了。。
在pod工程下载下来后,找不到图片
能不能支持下多window情况,现在只在keyWindow才能用
1.2.1可以添加数组,最新版如何传入数组捏???
用在ipad 横屏时会有bug,显示效果不对,action sheet,不是从底部滑出,而是从边上滑出
你好,你的项目写得非常棒,我也在用它。只是我有个疑问,你为什么把默认的“取消”按钮设置为黑色,或者说你为什么不把它的颜色设定也开放出来!
It seems that the backWindow is unused in class LCActionSheet, it that right? or pls explain it briefly. Thanks!
微信的现在有毛玻璃效果
我也玩
很多时候是不需要title的 开放个接口咯
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.