简体   繁体   中英

Unable to change UITableViewController color background

TitlesViewController : UITableViewController

I have the above code on iPhone development. This is associated to a xib (or nib) file. In this property file I change its background color. The problem is it does not reflect my new background color. Should I be manually loading the xib file to reflect it to my TitlesViewController?

viewcontroller.view.backgroundColor =颜色;

Some quick points:

You don't change the colour of a view controller, you change the colour of a view controller's view.

A xib is an XML file that tells Xcode how to create a matching nib. Neither are property files (you are likely mixing them up with plist files).

You should be able to set the background colour for just about any UIView (or subclass thereof) in your xib file. So the question is, how were you setting it the colour, what were you expecting to happen, and what did you get?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM