devlord
devlord

Reputation: 4164

How do I change the color of TableView and Button controls in iOS?

I designed a web app for iPhone and am now trying my hands at a native Objective-C version, and I'd like to retain some continuity with my original design. Since my web version uses CSS, I was able to customize the color palette, even though the UI was designed to imitate a native iPhone UI. I'd like to use a similar color scheme for my native app, but it doesn't seem so easy out of the box. I've gone through a couple tutorials and played around a bit with Interface Builder, inspecting the individual settings available for each control. My biggest questions are:

  1. Is it possible to (or how do I) change the color of a Round Rect Button?
  2. Is it possible to (or how do I) change the color of cells in a Table View?
  3. Where in the Cocoa Touch Library can I find the standard iOS UI buttons, e.g. the green "Call Back" and red "Delete" buttons in the native voice mail?

Thanks

Upvotes: 0

Views: 2392

Answers (1)

Max Seelemann
Max Seelemann

Reputation: 9364

  1. Nope, I don't think so. And you probably shouldn't anyways. In my opinion it's better to rather stay consistent with the OS and not the web... What you can do is to use a custom image.
  2. UITableViewCell has a property named backgroundView, which is only present if you have a grouped style. This view has -- just like every other view -- a background color. If you don't have this and want to color individual cells, build a custom cell where you put in a view as background view.
  3. As far as I know, they are not publicly available. However, you may find a lot of template images etc on the web that you can use.

Upvotes: 1

Related Questions