SAStickyHeader
SAStickyHeader copied to clipboard
Image is in Front When Table Is Dragged Upwards inside Navigation Bar
My image goes in front of my custom table view cells when I drag the table upwards. The table is inside the navigation bar which isn't translucent by the way. Any idea where I'm getting it wrong? Thanks.
@jaytrixz can you provide a screenshot?
Apologies for the late reply. Here are the screenshots:
@jaytrixz Thanks for the screenshot i managed to reproduce this bug, ill need to look for a solution that works
there bugs in updateImageViewFromScrollEvent
method i need to limit it so only expand if the touch is on the header
Thanks for the update!
Ive fixed the issue, can you try validate this with the latest version from master.
pod 'SAStickyHeader', :git => '[email protected]:shams-ahmed/SAStickyHeader.git', :branch => 'master'
Hi. Sorry for the late reply. I pulled the latest 0.5.1 from Cocoapods and it's still generating me the same issue :(
@jaytrixz did you place the above code snippet, it not tagged up yet as i need to confirm bug been resolved
I tried to paste the above code on my Podfile but it says I don't have access and fails. I just left it without mentioning the branch and link and just did a pod update
@jaytrixz ive pushed version 0.6.0 on cocoapods.
Hi. I've installed 0.6.0 but the behavior changed. It's not zooming anymore when I scroll down and when I scroll up, it still stays in front of the table. :(
This is what I do in my project:
- In storyboard, I select my UITableView and enable bounce
- In storyboard, I change my header section height to be 250
- In my swift file, in my
viewForHeaderInSection
, I justreturn SAStickyHeaderView(table: tableView, image: [UIImage(named: "loading_banner")])
- In my swift file, in my
heightForHeaderInSection
, I just return 250
That's it. My view controller is embedded from a navigation controller coming from my home view controller.
I changed the behaviour to only scroll if touch event is the header, if it finds a table cell then it wont scroll
Ok. It still has the original issue :(
i cant reproduce this, can you provide a sample project please or alter the example project please?
I'm currently doing that right now...
Here's the link to the sample project.
Ive looked into the sample code, i going to try create a proper fix soon in the mean time you can apply the header like this:
override func viewDidLoad() {
super.viewDidLoad()
tableView.tableHeaderView = SAStickyHeaderView(frame: CGRect(x: 0, y: 0, width: 320, height: 250), table: tableView, image: [UIImage(named: "loading_banner")])
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
// View doesn't get proper frame in viewDidLoad so adjust it here
guard var frame = tableView.tableHeaderView?.frame else {
return
}
frame.size.width = CGRectGetWidth(tableView.frame)
tableView.tableHeaderView?.frame = frame
}
Thanks. Will try that and update you.
Hi. I just resorted to following this tutorial and doing it manually. It works for me even on Swift 2.2
Hi shams, any update for this bug? Cause I can still reproduce this in your sample project. Thank you.
@glennposadas i made some progress on feature/forceTouch branch, but it not 100% solution. ATM am working on another project which is taking alot of my spare time, hopefully i can have a proper look at it soon. however if you come across a solution your welcome to send a pull request.