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 6811569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:20:38+00:00 2026-05-26T20:20:38+00:00

I am doing a bible reader application for iPhone, I want to implement a

  • 0

I am doing a bible reader application for iPhone, I want to implement a “night mode”.

I have done the button for night mode, the reading pane is a tableview, but other pages are also there in my app, my need is when the night mode is switched on the enire background of the view have to be changed to black and text appers to be in white.

I have put a dark gradient image view in the backside of the tableview and set it to hidden, and when the button is tapped I execute darkgradient.hidden = no; so the png will unhide and show behind the tableview as black.

I put the tableview background as clear color. The tableview cell has a label in it called chapterandverse label. I put this code in tableview,to change the background and change the text color in cellForRowAtIndexpath:

 if (imagedarkbackground.hidden == NO) {
            cell.chapterAndVerse.backgroundColor= [UIColor blackColor];
            cell.chapterAndVerse.textColor = [UIColor whiteColor];
            table.backgroundColor = [UIColor blackColor];
            cell.textLabel.textColor = [UIColor whiteColor];
        }
        else{
            //default
        }

The problem is, when I switch to another page and come back to the tableview page the black background changes to default. I know this is not the right way to set a nightmode in app, and also it changes the tableview background not the entire app background view, so how do I do this in a correct way?

  • 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-26T20:20:39+00:00Added an answer on May 26, 2026 at 8:20 pm

    If the background color is getting reset to default, your UITableViewController subclass is probably getting unloaded. Are you showing it as a modal view? If so you’ll have to save the night mode setting somewhere else, like a BOOL property on your app delegate. Then in your viewDidLoad, check that property and set the background color accordingly. Better still, save the value so if your app quits, when it comes back, night mode is still set to the same thing, but maybe not if a lot of time has passed since the app was last used.

    Better still, automatically set night mode based on the clock time. Yet better again, use data from the camera to detect the ambient light level. But in either case a button to override is also nice.

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

Sidebar

Related Questions

I have done a bible application in iphone,there is a last section called database
I am doing a Bible application ,i have a default Bible database english DB.Sqlite,the
Ha ii,I am doing a Bible application,my requirement is the user write a note
I am doing a reader application,which can sync text to googledoc,i got the working
Doing my first SL4 MVVM RIA based application and i ran into the following
Doing some jquery animation. I have certain divs set up with an attribute of
Doing some 3D stuff in wpf- want to use a simpler test to see
Doing a bit of reading around domain driven design and it seems that you're
Doing some R&D for my company. We are trying to have a listView that
Doing my first MVVM WPF application. I expected to see a Main() method in

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.