Closed johnharutyunyan closed 4 years ago
Configuring the space between items is fairly simple:
actionButton.itemAnimationConfiguration = .popUp(withInterItemSpacing: 15)
A different spacing for the first item is a bit more complicated at the moment and should probably be easier (I'll make it configurable #262).
let configuration = JJItemAnimationConfiguration()
configuration.itemLayout = JJItemLayout { items, actionButton in
var previousItem: JJActionItem?
for item in items {
let previousView = previousItem ?? actionButton
let spacing: CGFloat = previousItem == nil ? 60 : 15
item.bottomAnchor.constraint(equalTo: previousView.topAnchor, constant: -spacing).isActive = true
item.circleView.centerXAnchor.constraint(equalTo: actionButton.centerXAnchor).isActive = true
previousItem = item
}
}
configuration.closedState = .scale()
actionButton.itemAnimationConfiguration = configuration
And I'm realizing now that some methods in there are not public. I will fix that as soon as possible (#259)
This should be easier with version 2.5.0
actionButton.itemAnimationConfiguration = .popUp(withInterItemSpacing: 15, firstItemSpacing: 30)
I will close this now. If you have more questions feel free to reopen it.
Hello , guys. Is it possible to have space between items ? Can I have different spacing between From Action Button and First Item - 30, after First Item spacing - 15