Commit 8152043b by Daniel Dahan

updated NavigationBar project

parent 5e6d8784
......@@ -112,9 +112,11 @@ class AppSearchBarViewController: SearchBarViewController {
searchBarView.placeholderTextColor = MaterialColor.grey.darken4
searchBarView.textField.font = RobotoFont.regular
searchBarView.textField.delegate = self
searchBarView.contentInset.left = 8
searchBarView.contentInset.right = 8
searchBarView.clearButton = clearButton
searchBarView.rightControls = [backButton]
searchBarView.leftControls = [backButton]
}
}
......
......@@ -70,6 +70,8 @@ class FeedViewController: UIViewController {
navigationbar.backgroundColor = MaterialColor.blue.base
navigationbar.backButton.tintColor = MaterialColor.white
}
collectionView.reloadData()
}
override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
......
......@@ -109,8 +109,6 @@ class ViewController: UIViewController {
view.addSubview(navigationBar)
menuButton.backgroundColor = MaterialColor.yellow.accent1
let item: UINavigationItem = UINavigationItem()
item.titleLabel = titleLabel
item.leftControls = [menuButton]
......
......@@ -250,11 +250,11 @@ public class NavigationBar : UINavigationBar {
public override func layoutSubviews() {
super.layoutSubviews()
if let item: UINavigationItem = backItem {
item.titleView?.grid.reloadLayout()
} else if let item: UINavigationItem = topItem {
if let item: UINavigationItem = topItem {
layoutNavigationItem(item)
}
topItem?.titleView?.grid.reloadLayout()
}
public override func pushNavigationItem(item: UINavigationItem, animated: Bool) {
......@@ -311,14 +311,13 @@ public class NavigationBar : UINavigationBar {
if 32 >= height || nil == item.detailLabel {
t.font = t.font?.fontWithSize(20)
item.titleView!.grid.axis.rows = 1
item.detailLabel?.hidden = true
} else if let d: UILabel = item.detailLabel {
d.grid.rows = 1
d.hidden = false
d.font = d.font.fontWithSize(12)
t.font = t.font.fontWithSize(17)
item.titleView!.addSubview(d)
item.titleView!.grid.axis.rows = 2
item.titleView!.grid.views?.append(d)
......@@ -367,7 +366,7 @@ public class NavigationBar : UINavigationBar {
backButtonImage = nil
backgroundColor = MaterialColor.white
depth = .Depth1
contentInset = UIEdgeInsetsMake(2, 6, 2, 6)
contentInset = UIEdgeInsetsMake(2, 2, 2, 2)
prepareBackButton()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment