Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6627589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:01:55+00:00 2026-05-25T22:01:55+00:00

When using Apple’s UISplitViewController, the master view has a black toolbar when in portrait

  • 0

When using Apple’s UISplitViewController, the master view has a black toolbar when in portrait mode and gray when in landscape.

I have created a label inside a UIView on the toolbar, as described here: Adding a UILabel to a UIToolbar, but by default the text is black which means it is only visible in landscape mode.

How should I code my view controller so it can change the text color so it is always visible, and ideally to match the way Apple apps like Mail work (white in portrait and dark gray in landscape) ?


…later…

Following the direction in Alan Moore’s answer, I decided to use code like this:

UIInterfaceOrientation o = [UIApplication sharedApplication].statusBarOrientation;
if (UIDeviceOrientationIsPortrait(o)) 
    label.textColor = [UIColor whiteColor];
else
    label.textColor = [UIColor darkTextColor];

This is called from my viewDidLoad and didRotateFromInterfaceOrientation methods. Seems to me that didRotate is better than shouldRotate for this case.

Also note I am querying the statusBar, because in my view self.interfaceOrientation always returns 1. This is also noted here: Determine UIInterfaceOrientation on iPad.

Not 100% sure that darkText is the right color for landscape.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:01:55+00:00Added an answer on May 25, 2026 at 10:01 pm

    I would add code to the

    - (BOOL)shouldAutorotateToInterfaceOrientation:(...) {
    }
    

    which would do a setTextColor on your label depending on whether it’s rotating to portrait or landscape mode.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Apple's sample code for having separate Portrait and Landscape view controllers (presenting/dismissing
I am using apple's custom table view cell code and modifying the drawRect code
I've come across this issue in my application, and have reproduced it using Apple's
I have two NSScrollView's with scroll synchronized with each other (using Apple's example )
I'm using Apple's example code for AVCaptureSession, and the UIImage that gets created is
I just installed XCode 4 today (using Apple mac app store), and I created
Hello i have implemented photo slideshow with scrollview and imageview using apple's scrolling example
I'm making an app which has a tableview and a DetailViewController. I'm using Apple's
i am using apple's sample URLCache ,but when i mention url, it loads data
Using the Apple OS X Cocoa framework, how can I post a sheet (slide-down

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.