romansorochak / parallaxheader Goto Github PK
View Code? Open in Web Editor NEWSimple way to add parallax header to UIScrollView/UITableView written in Swift.
License: MIT License
Simple way to add parallax header to UIScrollView/UITableView written in Swift.
License: MIT License
I'm trying to use ParallaxHeader to create something like this.
but when I use snapkit with the blur+icon example to make half of the icon go beyond the bottom margin, the bottom half of the icon is clipped.
I'm using
roundIcon.snp.makeConstraints { make in
make.left.equalToSuperview().offset(30)
make.bottom.equalToSuperview().offset(50)
make.width.height.equalTo(100)
}
to align the round icon to the bottom left, like in the image above.
It seems that this code is responsible for the clipping but I understand it is necessary for the blur to happen nicely. Is there a workaround to have subviews go over the margin of the parallaxHeader?
Thanks!
when adding section headers and using the Plain style for the tableview the header will remain on the location where it starts before you make the parallax header smaller.
Is there a way to fix this so it moves smoothly with the header?
if a do this
let header = TreeLabelsHeaderView()
header.name.text = "Rafael"
header.age.text = "29 years"
header.country.text = "Brasil"
tableView.parallaxHeader.view = header
tableView.parallaxHeader.height = 400
tableView.parallaxHeader.minimumHeight = 0
tableView.parallaxHeader.mode = .topFill
// on UITest
let app = XCUIApplication()
XCAssertTrue(app.staticTexts["Rafael"].exists)
XCAssertTrue(app.staticTexts["29 years"].exists)
XCAssertTrue(app.staticTexts["Brasil"].exists)
this test broke and all elements of TreeLabelsHeaderView is not founded on acessibility tree.
Swift 4.2 compiler error:
'NSLayoutFormatOptions' has been renamed to 'NSLayoutConstraint.FormatOptions'
Hi, firstly thank's for this app. I am using map on first cell (parallaxHeader.view) and i need border bottom this map. This border that will always be visible. Thanks!
pod install 找不到 3.0.0 版本
Hi,
Is there a way to remove the parallax header view from tableview?
thanks
With Swift 5
Xcode suggest me to change things like:
NSLayoutFormatOptions
to NSLayoutConstraint.FormatOptions.
NSLayoutAttribute.centerX
to NSLayoutConstraint.Attribute.centerX
NSLayoutRelation.equal
to NSLayoutConstraint.Relation.equal
bytes: 4, alignedTo: 1
to byteCount: 4, alignment: 1
Is there a way to perform an action when the parralaxHeader is tapped?
The header view label is pushed up too high. Could be a problem with snapKit. They have a swift 4 branch i tried installing by this repo installs 3.2
Hi, I'm implementing a comments tableview with a parallax header. To show insertion of comments I'm using scrollToRow but when I use it on a tableView with parallax header, the table is scrolled down to the bottom. I've tested it without parallax header scrolling works exactly as needed. Also my table style is plain and I'm using a section header as a comment having replies as cells. I've tested this in MXParallaxHeader too and it also produces same problem.
Kindly let me know if anything I'm missing here or if you can relate the issue.
Thanks
After install with cocoapods, there is a compiler error Type 'UILayoutPriority' (aka 'Float') has no member 'defaultHigh'
in ParallaxHeader.swift Anyone know whats happening?
Hi.
Can I determine indexPathsForVisibleRows
with header is on progress?
EDIT)
There was some confusion.
Using the parallax header with a UITableView that has header sections causes scrolling issues with the header sticking in the view until scrolling to another header section.
class UserHomeViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
var tabBar:TabBar?
let sections = ["Drafts", "Scheduled", "Past"]
@IBOutlet weak var eventsTableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
initUI()
}
/// Initialize any UI components
private func initUI(){
initTableView()
tabBar = TabBar.init(self.view, navController: self.navigationController!, isVendor: false, selectedTab: 0)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
/// Initialize the trip table view
fileprivate func initTableView(){
eventsTableView.register(UINib(nibName: "TripTableViewCell", bundle: nil), forCellReuseIdentifier: "TripTableViewCell")
eventsTableView.rowHeight = 60
eventsTableView.parallaxHeader.view = (Bundle.main.loadNibNamed("ParallaxHeaderView", owner: self, options: nil)![0] as? UIView)!
eventsTableView.parallaxHeader.height = 120
eventsTableView.parallaxHeader.minimumHeight = 0
eventsTableView.parallaxHeader.mode = .topFill
}
/// Set the number of entries in table view
/// - parameter tableView: table view we are getting the size of.
/// - parameter section: section of the table view we are getting the size of.
/// - returns: the size of the table view.
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
var size = 0
switch section {
case 0:
size = 5
case 1:
size = 5
case 2:
size = 5
default:
size = 0
}
return size
}
/// Set the values for the table view cells
/// - parameter tableView: table view that the cell is being initialized for.
/// - parameter indexPath: row in the table view that the cell will be placed.
/// - returns: the initialized table view cell.
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "TripTableViewCell", for: indexPath) as! TripTableViewCell
return cell
}
func numberOfSections(in tableView: UITableView) -> Int {
return sections.count
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 30.0
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let header = Bundle.main.loadNibNamed("EventsHeaderView", owner: self, options: nil)![0] as! EventsHeaderView
header.headerLabel.text = sections[section]
return header
}
}
Hi All,
I'm having having an issue where the header is shown bellow the status bar.
So the header.y == statubar.maxY.
The tableview's.y == 0. So the content is shown bellow the status bar.
Can anyone help?
Thanks in advance!
The library is excellent ,
It will be excellent if we can use with CollectionView
Hi
How to add blur to collection view that uses as table header?
If I can't add blur, How to implement images slider?
Thank you
I need to ParallaxHeader module of Swift 4..
plz support to us
Hello,
I detect error with static table view.
Content of table view cell is under imagen parallax header. It´s correct.
But, description table view cell, is over imagen parallax header. It´s error.
How can i solved it? and description table view cell display under imagen parallax header??
Thanks you much!
Hey. On iOS 11, the height of the parallax header is equal to the height that I set + the height of the navigation bar + the height of the status bar. On iPhone 8/8+ height = myHeight + 64, on the iPhone X height = myHeight + 88. On a lower version, iOS is all good. How can this problem be solved?
Is there any problem with this version?
Thanks you!
hi there , recently I updated my app and is giving me some syntax changes , I was able to unlock your code to make them, but it would be super awesome If you could take some of your time to make it avalaiable for swift 5 please
Hi
i need to add a UIRefreshControl to the ParallaxHeader. But it always appears above the ParallaxHeader. Is there any way to add the UIRefresfControl above the blur view?
Thanks, Felix
while scrolling on blurRoundIconParallax, the section title is showing above on parallaxHeader. it should hide inside header View.
ScreenShot : https://imgur.com/a/k3ZHB
I am following same code written on github.
Thank you!
Hi!
Is there option to support Carthage?
I am using PaginationManager for load more functionality.
But after adding parallaxHeader its work perfect but my load more functionality is disable.
Can any one help me how to use parallaxHeader with load more functionality
I have added a search bar in my parallax header. Everytime i start editing the search bar the tableView scrolls down automatically. Please help
Hi, I'm implementing a comments tableview with a parallax header. To show insertion of comments I'm using scrollToRow but when I use it on a tableView with parallax header, the table is scrolled down to the bottom. I've tested it without parallax header scrolling works exactly as needed. Also my table style is plain and I'm using a section header as a comment having replies as cells.
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.