You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks dude, you have created a nice tool!
I have read the source code that the position for ActionButton is fixed at bottom right of current screen, not be able to adjust the position, so if someone uses Action in a Tab pattern App., the ActionButton can be hidden by the Tab Controller.
So I guess whether you can add parameters in the initializer or create a helper method for changing the layout parameters.
I tried to change the init method to:
public init(attachedToView view: UIView, items: [ActionButtonItem]?, tailingOffset: CGFloat = 15.0, bottomOffset: CGFloat = 15.0) {
......
self.installConstraints(tailingOffset, bottomOffset: bottomOffset)
}
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse constraint format:
Encountered metric with name "tailingOffset", but value was not specified in metrics or views dictionaries
V:[floatButton]-(tailingOffset)-|
^'
So,
change "V:[floatButton]-(tailingOffset)-|" to "V:[floatButton]-(\(tailingOffset))-|" etc
exchange to bottomOffset for V, and tailingOffset for H
Hi,
Thanks dude, you have created a nice tool!
I have read the source code that the position for ActionButton is fixed at bottom right of current screen, not be able to adjust the position, so if someone uses Action in a Tab pattern App., the ActionButton can be hidden by the Tab Controller.
So I guess whether you can add parameters in the initializer or create a helper method for changing the layout parameters.
I tried to change the init method to:
public init(attachedToView view: UIView, items: [ActionButtonItem]?, tailingOffset: CGFloat = 15.0, bottomOffset: CGFloat = 15.0) {
......
self.installConstraints(tailingOffset, bottomOffset: bottomOffset)
}
private func installConstraints(tailingOffset: CGFloat = 15.0, bottomOffset: CGFloat = 15.0) {
......
let trailingSpacing = NSLayoutConstraint.constraintsWithVisualFormat("V:[floatButton]-(tailingOffset)-|", options: NSLayoutFormatOptions.AlignAllCenterX, metrics: nil, views: views)
let bottomSpacing = NSLayoutConstraint.constraintsWithVisualFormat("H:[floatButton]-(bottomOffset)-|", options: NSLayoutFormatOptions.AlignAllCenterX, metrics: nil, views: views)
......
}
Hope you can change for some customization.
Thanks
Leon
The text was updated successfully, but these errors were encountered: