liuzhiyi1992 / spreadbutton Goto Github PK
View Code? Open in Web Editor NEWa Button can spread its sub path button like the flower if you click,once again,close. oc & swift
a Button can spread its sub path button like the flower if you click,once again,close. oc & swift
请问应该怎么做
Thank you very much for this nice component. I really love this.
The problem I'm having while using is I don't want to float this around the whole view. I want it to move within the boundary of a custom view. To achieve that I added a custom view and added this spread button as subview.
But SpreadButton
instance is not showing. What is the proper way to restrict SpreadButton floating boundary. Thank you.
使用的时候发现2.2和3.0的版本在拖到边缘的时候会有闪退。
2016-11-06 23:09:12.399 SpreadButton[2091:803446] -[_SwiftValue pointValue]: unrecognized selector sent to instance 0x15d64d3d0
2016-11-06 23:09:12.402 SpreadButton[2091:803446] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_SwiftValue pointValue]: unrecognized selector sent to instance 0x15d64d3d0'
*** First throw call stack:
(0x181131900 0x18079ff80 0x18113861c 0x1811355b8 0x18103968c 0x183838544 0x183837af4 0x183837214 0x185e5fe84 0x185e5fb48 0x186131c30 0x185e60144 0x181028370 0x181028268 0x185e5fc68 0x186131c30 0x185e60144 0x181028370 0x181028268 0x185e5fc68 0x186131c30 0x18612058c 0x185e28dd0 0x186120454 0x1861207a0 0x1860eab60 0x185e2230c 0x1810e8efc 0x1810e8990 0x1810e6690 0x181015680 0x182524088 0x185e8cd90 0x1000b11c0 0x180bb68b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
Hello, I am using your framework to create a spread button. But seem like you have an issue with the buttons. When I spread-in the buttons, there is a flash of the last added button on the left-up corner, just below the status bar.
Do you know why ?
Here is the code that I used like you did.
`func setup_spread_button()
{
let btn1 = SpreadSubButton(backgroundImage: UIImage(named: "edit"), highlightImage: UIImage(named: "edit")) { (index, sender) -> Void in
print("first")
}
let btn2 = SpreadSubButton(backgroundImage: UIImage(named: "delete_user"), highlightImage: UIImage(named: "delete_user")) { (index, sender) -> Void in
print("second")
}
let btn3 = SpreadSubButton(backgroundImage: UIImage(named: "blocked"), highlightImage: UIImage(named: "blocked")) { (index, sender) -> Void in
print("third")
}
let btn4 = SpreadSubButton(backgroundImage: UIImage(named: "share"), highlightImage: UIImage(named: "share")) { (index, sender) -> Void in
print("four")
}
let btn5 = SpreadSubButton(backgroundImage: UIImage(named: "logout"), highlightImage: UIImage(named: "logout")) { (index, sender) -> Void in
print("five")
}
let spreadButton = SpreadButton(image: UIImage(named: "setting"),
highlightImage: UIImage(named: "setting"),
position: CGPoint(x: 40, y: UIScreen.main.bounds.height - 40))
self.spreadButton = spreadButton
spreadButton?.setSubButtons([btn1, btn2, btn3, btn4, btn5])
spreadButton?.mode = SpreadMode.spreadModeFlowerSpread
spreadButton?.direction = SpreadDirection.spreadDirectionLeftDown
spreadButton?.radius = 100
spreadButton?.positionMode = SpreadPositionMode.spreadPositionModeTouchBorder
/* and you can assign a newValue to change the default
spreadButton?.animationDuring = 0.2
spreadButton?.animationDuringClose = 0.25
spreadButton?.radius = 180
spreadButton?.coverAlpha = 0.3
spreadButton?.coverColor = UIColor.yellowColor()
spreadButton?.touchBorderMargin = 10.0
*/
if spreadButton != nil {
self.view.addSubview(spreadButton!)
}
}
`
Regards,
Hary
期待~~
在closeButton:中btn.frame = CGRectMake(0, 0, btn.bounds.size.width, btn.bounds.size.height);是这行代码导致的,设置center不会出现这样的问题btn.center = _powerButton.center;
When building my app in Xcode 10 the images aren't loading in many instances. Using the same code to build in Xcode 9 they populate and work correctly every time.
I have a setup with four buttons on my spreadButton and it seems random as to which images will pull in. On some builds only 2/4 buttons load, sometimes only 1, and very very rarely all 4 will populate.
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.