choiceyou / fwpopupview Goto Github PK
View Code? Open in Web Editor NEW弹窗控件:支持AlertView、Sheet、自定义视图的PopupView。AlertView中可以嵌套自定义视图,各组件的显示隐藏可配置;Sheet仿微信样式;同时提供自定义弹出。更多配置请参考”可设置参数“,提供OC使用Demo。
License: MIT License
弹窗控件:支持AlertView、Sheet、自定义视图的PopupView。AlertView中可以嵌套自定义视图,各组件的显示隐藏可配置;Sheet仿微信样式;同时提供自定义弹出。更多配置请参考”可设置参数“,提供OC使用Demo。
License: MIT License
你好,FWSheetView点击空白区域hide view功能,考虑增加一下吗?
这个属性在hide时 makeKey 会导致其他使用keyWindow属性显示不出来。
bug原因:
赋值windows.first 并不是keyWindow
在hide时又做了makeKey操作,导致在使用keyWindow属性时不能被显示。
此处赋值的时机是否应该放在吊起FWPopupSWindow时?
望改进。
这个selectedTitleTextAttributes 属性貌似并没有用到呀
传入 attachview 弹窗试图本身的按钮响应全部失效 点击就dismiss了啊
如果仅仅设置颜色不设置大小(@{NSForegroundColorAttributeName : UIColor.whiteColor})文字就会显示成几个点
设置 touchWildToHide = "1"
后支持点击遮罩让当前弹窗消失,但是不走 cancenlBlock
,是否可以支持设置使其可以走 cancenlBlock
iOS14以后datePicker需要适配一下了
swift版的带输入框TextField的AlertView, 多试几遍会出现不显示弹窗
如果只想竖屏不想支持横屏切换是否有参数可以设置?
iPhone X 底部显示不好。
暗黑适配后版本,发现 crash 异常。
`
import UIKit
class SNHomeMoreView: FWPopupView {
lazy var tableView : UITableView = {
let tableView = UITableView.init(frame: CGRect.zero, style: .plain)
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = .white
tableView.isEditing = true
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "SNHomeMoreCell")
tableView.frame = CGRect.init(x: 0, y: 0, width: 300, height: 400)
return tableView
}()
var titles = ["a","b","c","d","e","f","g"]
override init(frame: CGRect) {
super.init(frame: frame)
self.backgroundColor = UIColor.white
let vProperty = FWPopupViewProperty()
vProperty.popupCustomAlignment = .topCenter
vProperty.popupAnimationType = .frame
vProperty.maskViewColor = UIColor(white: 0, alpha: 0.5)
vProperty.touchWildToHide = "1"
vProperty.popupViewEdgeInsets = UIEdgeInsets(top: kTopH, left: 0, bottom: 0, right: 0)
vProperty.animationDuration = 0.5
//vProperty.cornerRadius =
self.vProperty = vProperty
self.addSubview(tableView)
tableView.reloadData()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
extension SNHomeMoreView : UITableViewDelegate,UITableViewDataSource{
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 44
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return titles.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "SNHomeMoreCell", for: indexPath)
cell.selectionStyle = UITableViewCell.SelectionStyle.none
cell.textLabel?.text = titles[indexPath.row]
return cell
}
// 设置 cell 是否允许移动
func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool {
return true
}
// 移动 cell 时触发
func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) {
print("\(sourceIndexPath.row) *** \(destinationIndexPath.row)")
let source = titles[sourceIndexPath.row]
let destination = titles[destinationIndexPath.row]
titles[destinationIndexPath.row] = source
titles[sourceIndexPath.row] = destination
tableView.reloadData()
}
}
`
pod 方式集成, FWPopupWindow下的touchWildToHide无法通过点语法设置
在您示例代码的 自定义菜单中
FWMenuView.menu 中 设置
property.popupCustomAlignment = .bottomCenter
property.popupViewSize = CGSize(width: UIScreen.main.bounds.width - 32, height: 200)
会导致,最终的menuView位置不正确
X轴会向左偏移 property.popupViewSize
我设置的一半 暂时解决办法增加 property.popupViewEdgeInsets
的left 值
属性过多,似乎还有属性重叠,增加了复杂度
open class FWMenuViewProperty: FWPopupViewProperty
这继承关系感觉没啥必要,徒增复杂度和代码数量,且这两个class中属性设置重叠
iPad开2个窗口(同一个App的2个窗口)并排,其中1个窗口无法正确弹出菜单。
Compiling for iOS 8.0, but module 'SnapKit' has a minimum deployment target of iOS 10.0: /Users/mac/Library/Developer/Xcode/DerivedData/TLZB-eafleshslmajwzhhtwkwjiuyjvjn/Build/Products/Debug-iphoneos/SnapKit/SnapKit.framework/Modules/SnapKit.swiftmodule/arm64.swiftmodule
prefersHomeIndicatorAutoHidden,这个可能也需要适配下,老铁
是否支持自定义的item 的 title的颜色或者图标更改呢
Xcode 10.2 swift 5.0
let alertView = FWAlertView.alert(title: "标题", detail: "带输入框", inputPlaceholder: "请输入...", keyboardType: .default, isSecureTextEntry: false, customView: nil, items: items)
修改keyboardtype default键盘出现遮挡。 项目同样用到了IQKeyboardManagerSwift。
如果有个public 数组装有底部按钮,或者把一些控件暴露出来,这样我就好些分类处理暗黑适配的问题。
我的代码中设置了attachedView.popupMenu.attachedView = self.view 从而导致了内存泄漏。
初步分析是attachedView持有self.view无法释放,建议attachedView设置为weak。
背景颜色,字体颜色,字体大小都无法设置?
Compiling for iOS 8.0, but module 'SnapKit' has a minimum deployment target of iOS 10.0: /Users/relax/Library/Developer/Xcode/DerivedData/Honeybee-dscsjclqjfzwvfaxehqljaqkpwcf/Build/Products/TestDebug-iphoneos/SnapKit/SnapKit.swiftmodule/arm.swiftmodule
希望作者可以支持 Swift4.2.
我看FWMenuView代码里面没有设置到字体大小的代码
你好,版本3.0.6。用Swift语言在iPhone竖屏时创建一个topCenter居中的菜单FWMenuView。
弹出菜单显示后,将手机从竖屏旋转为横屏,底部遮罩层未做自动调整适应,导致显示位置发生偏移。
目前你弹窗里面的按钮什么的都是一些临时变量。你能否使用一个数组装好所有空间,然后使用tag方式,让我可以获取那些控件,我需要做暗黑适配。或者你有更好方式,能做到,感谢大神
期望可以判断一下 如果当前有一个弹窗存在就不要在显示了,就显示当前的就可以了
在使用FWSheetView.sheet时有去替换UIWindow,隐藏时没有将原本的window换回来,导致后续在获取keyWindow的时候,获取到的Window Class不正确,往window上add控件无效
// let itemClickedBlock: FWPopupItemClickedBlock = { (popupView, index, title) in
+ let itemClickedBlock: FWPopupItemClickedBlock = {[weak self] (popupView, index, title) in
+ guard let weakSelf = self else {
+ return
+ }
if itemBlock != nil {
// itemBlock!(self, index, title)
+ itemBlock!(weakSelf, index, title)
}
}
导入报错
如果项目中已经导入了SnapKit,再导入这个库,运行会报错
如题:能否支持下,展示到别的父视图上,而不是 一定是 Window
FWPopupView使用其他版本报Compiling for iOS 8.0, but module 'SnapKit' has a minimum deployment target of iOS 10.0,如果使用3.1.5版本报Cannot invoke initializer for type 'FWPopupWindow' with no arguments,怎么处理???
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.