Commit 4aef14c6 by Daniel Dahan

fixed text alignment issue in NavigationBar and Toolbar

parent 510778e5
......@@ -122,11 +122,9 @@ class ItemViewController: UIViewController {
/// Prepares the navigationItem.
private func prepareNavigationItem() {
navigationItem.titleLabel.text = "Item"
navigationItem.titleLabel.textAlignment = .Left
navigationItem.titleLabel.textColor = MaterialColor.white
navigationItem.detailLabel.text = "January 22, 2016"
navigationItem.detailLabel.textAlignment = .Left
navigationItem.detailLabel.textColor = MaterialColor.white
navigationItem.rightControls = [shareButton]
......
Pod::Spec.new do |s|
s.name = 'Material'
s.version = '1.41.0'
s.version = '1.41.1'
s.license = 'BSD'
s.summary = 'An animation and graphics framework for Material Design in Swift.'
s.homepage = 'http://cosmicmind.io'
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.41.0</string>
<string>1.41.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -385,9 +385,12 @@ public class NavigationBar : UINavigationBar {
titleLabel.sizeToFit()
detailLabel.sizeToFit()
let diff: CGFloat = (contentView.frame.height - titleLabel.frame.height - detailLabel.frame.height) / 2
titleLabel.frame.size.height += diff
titleLabel.frame.size.width = contentView.frame.width
detailLabel.frame.size.height += diff
detailLabel.frame.size.width = contentView.frame.width
detailLabel.frame.origin.y = titleLabel.frame.height
} else {
detailLabel.removeFromSuperview()
......
......@@ -52,9 +52,12 @@ public class Toolbar : StatusBarView {
titleLabel.sizeToFit()
detailLabel.sizeToFit()
let diff: CGFloat = (contentView.frame.height - titleLabel.frame.height - detailLabel.frame.height) / 2
titleLabel.frame.size.height += diff
titleLabel.frame.size.width = contentView.frame.width
detailLabel.frame.size.height += diff
detailLabel.frame.size.width = contentView.frame.width
detailLabel.frame.origin.y = titleLabel.frame.height
} else {
detailLabel.removeFromSuperview()
......
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