I've been having a problem with one of my Xcode projects. I'm trying to hide the navigation bar of an IOS app, but retain a white tint on the time, carrier and battery section/icons. I can only turn the tint white if I have the navigationController set to false in self.navigationController?.navigationBarHidden = false
When it is set to true, the tint turns white and there is no issue, but the navigation bar is there in color. Here is my code.
import UIKit
class ViewController: UIViewController, UITextFieldDelegate {
@IBOutlet weak var menuButton:UIBarButtonItem!
@IBOutlet weak var emailTxt: UITextField!
@IBOutlet weak var passwordTxt: UITextField!
@IBOutlet weak var signinBtn: UIButton!
@IBOutlet weak var signupBtn: UIButton!
var varView = Int()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
emailTxt.delegate = self
let theWidth = view.frame.size.width
let theHeight = view.frame.size.height
emailTxt.frame = CGRectMake(40, 200, theWidth-80, 30)
passwordTxt.frame = CGRectMake(40, 240, theWidth-80, 30)
signinBtn.frame = CGRectMake(theWidth-228, 340, 59, 30)
signupBtn.frame = CGRectMake(theWidth-228, 390, 59, 30)
let nav = self.navigationController?.navigationBar
nav?.barStyle = UIBarStyle.Black
nav?.tintColor = UIColor.whiteColor()
nav?.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor()]
self.navigationController?.navigationBarHidden = true
//maparea
}
func textFieldShouldReturn(textField: UITextField) -> Bool {
textField.resignFirstResponder()
return true;
}
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
//emailTxt.resignFirstResponder()
self.view.endEditing(true)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func signInBtn(sender: AnyObject) {
PFUser.logInWithUsernameInBackground(emailTxt.text!, password: passwordTxt.text!) {
(user:PFUser?, error:NSError?) -> Void in
if error == nil {
print("logIn")
self.performSegueWithIdentifier("gotoMainVCFromSigninVC", sender: self)
} else {
print("error")
}
}
}
}