Comments (4)
Hello @StevenArmandLee
I'm sorry for being late.
If you can possible, use the below.
override func viewDidLoad() {
KCFABManager.defaultInstance().show()
}
override func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) {
if velocity.y > 0 {
KCFABManager.defaultInstance().hide()
} else {
KCFABManager.defaultInstance().show()
}
}
Or I added sticky
property in version 2.1.0
.
override func viewDidLoad() {
super.viewDidLoad();
fab.sticky = true // sticking to parent UIScrollView(also UITableView, UICollectionView)
view.addSubview(fab)
}
override func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) {
if velocity.y > 0 {
fab.isHidden = true
} else {
fab.isHidden = false
}
}
from floaty.
I found the solution by using this
override func scrollViewDidScroll(_ scrollView: UIScrollView) {
floatingActionButton.paddingY = 20-scrollView.contentOffset.y
if scrollView.contentOffset.y == 0 {
floatingActionButton.paddingY = 20
}
}
This works perfectly fine for me, in case you want to make it hidden when you scroll up, add this line also
if scrollView.contentOffset.y <= 45 {
floatingActionButton.isHidden = false
}
else {
floatingActionButton.isHidden = true
}
ERROR, it will be placed at wrong place when we scroll up and down many many times, when I check the location of the contentOffset.y, it is at the right place, however in my UI it is under my screen
from floaty.
@kciter btw I noticed that the button is solid color when I use it in a view controller which contain table view
while it is transparent color at tableviewcontroller (I can see the line between cells)
how do I make all of them a solid color? I made sure my alpha is 1
from floaty.
@kciter ok so the color is correct is just that somehow the cell separator is in front of the button. and when we click the button it will go to the front of the cell separator. tried to put it to the most front and it does not work also
any solution?
from floaty.
Related Issues (20)
- How to make fab button to hide only on tapping cross button item and not on background semi transparent view
- Customize Image
- How to change Floaty Position ?
- Floaty hit are is way too big
- Cant add Floaty button to Window level HOT 1
- Add background view for item label
- Floaty is preventing from changing device orientation
- Overlay & Width & Height Label HOT 1
- preferredStatusBarStyle isn't called due to Floaty.global.button
- Can I handle just one single action?
- Floaty padding Y is not working when set rtlMode property is true!
- How to cover Overlay on TabBar & NavigationBar
- How to add button Floaty type in storyboard? HOT 1
- Floaty items aren't clickable when I turn voiceover on
- Floaty only respond to touch for the first time on simulator when built by Xcode 14. HOT 3
- Pod is not working in m1 chip system
- Isn't the [weak self] needed in addItem() ?
- Item icons are not in center
- Problem with tabbar and overlay
- Unable to reload data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from floaty.