title: UIView background Color
body: <p>I am trying to create a grid view by using a UITableView (my older questions have pointed me in this direction) and am currently setting up the views for the individual items. Having created a custom UITableViewCell that displays 3 items per row, I have decided to pull these items into a subclass of UIView called ItemView.</p>
  
  <p>This ItemView will then be added as a subview to the custom UITableViewCell to display the grid. Anyway, I have managed to create the view and can get it to display a UILabel fine, however I am having trouble in changing ItemView to be transparent apart from the UIViews (Labels, buttons, images etc) within it. Here is my code for the UIView:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  @interface ItemView : UIView {
  }
  @end
  
  #import "ItemView.h"
  @implementation ItemView
  
  - (id)initWithFrame:(CGRect)frame {
      if ((self = [super initWithFrame:frame])) {
      }
      return self;
  }
  
  - (void)drawRect:(CGRect)rect {
    [self setBackgroundColor:[UIColor lightGrayColor]];
  }
  
  - (void)dealloc {
    [super dealloc];
  }
  @end
  </code></pre>
  
  <p>Where should I set the background color for it to work properly?</p>
  
  <p>Cheers</p>