Closed steffimueller closed 9 years ago
+1
@ltebean Could you please help me with this issue?
@steffimueller I guess it is due to the table view position, did you put it behind the navbar or under the navbar? Could you share the entire project to me, since that will make it easy to find out what's wrong with it
@ltebean Thanks for help. Here is the project:
https://github.com/steffimueller/LTNavigationBar-TestProject
I suppose it is just a small thing. :-)
just set the topView as the table header view: tableView.tableHeaderView = topView
I tried this before like here:
override func viewDidLoad() {
super.viewDidLoad()
self.navigationItem.setLeftBarButtonItem(UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Cancel, target: self, action: "sdfsdf"), animated: true)
self.tableView.delegate = self
self.tableView.dataSource = self
self.tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: cellIndentifier)
self.navigationController?.navigationBar.lt_setBackgroundColor(UIColor.clearColor())
tableView.autoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleWidth
topView = UIView(frame: CGRectMake(0, 0, 320, 212))
topView.contentMode = UIViewContentMode.ScaleToFill
topView.autoresizesSubviews = true
topView.backgroundColor = UIColor.yellowColor()
// topView.clipsToBounds = true
tableView.tableHeaderView = topView
// tableView.backgroundView = testView
// tableView.addSubview(topView)
let img = UIImage(named: "bg")
topImageView = UIImageView(image: img)
topImageView?.frame = CGRectMake(0, -89, 320, 307)
topImageView?.contentMode = UIViewContentMode.ScaleToFill
topView.addSubview(topImageView!)
// topView.superview?.sendSubviewToBack(topView)
}
The result is this:
The problem is that the first table row is now overlapped by the image. Any idea?
I want to get the same result as you did in your parallax branch but just using nib instead of Storyboard.
@ltebean I post a bounty on stack overflow may be you can answer that?
http://stackoverflow.com/questions/30130879/uiview-as-top-view-for-uitableview
@steffimueller please add me to your repo
done!
@steffimueller I pushed, this commit: https://github.com/steffimueller/LTNavigationBar-TestProject/commit/3da723a073e4f9234d0533d32032c4f7610134b1
@ltebean Thank you but there is still a difference to the parallax branch. When you pull down the table there is a white background appearing at the top. This does not happen in you r parallax branch. Can you please fix that too?
Thank you so much for your help.
@ltebean Could you please help me with this last point. I guess it is just one property to set but I canot find it.
When you pull down the table there is a white background appearing at the top. This does not happen in you r parallax branch. Can you please fix that too?
@ltebean I still have this issue. Could you please provide a version of your parallax which does not use Storyboard or InterfaceBuilder? Please!
I tried to create your example in code instead of in the storyboard.
In AppDelegate I created:
Page1ViewController is:
In the nib of
Page1ViewController
I just inserted aUITableView
and linked the outlet totableView
.Here is the result when I run the app:
It works like your demo app with the exception that the header does not have the correct height. How can I change that?
Thanks for help!