0

I have the following text in my .h file:

CGRect frame = CGRectMake(0, 0, 480, 49);
UIView *v = [[UIView alloc] initWithFrame:frame];
UIImage *i = [UIImage imageNamed:@"background.png"];
UIColor *c = [[UIColor alloc] initWithPatternImage:i];
v.backgroundColor = c;
[[self tabbar] addSubview:v];

But have an error on the last line saying: "Receiver type 'viewcontroller' for instance message does not declare a method with selector 'tabbar'

I am trying to set background.png to be the background of the tabbar view.

Im clearly missing something...

  • 1
    There is no self.tabbar. You can get `[self.tabBarController tabBar]` but it is read only. – lnafziger Apr 06 '12 at 18:06
  • Look into this previous question: http://stackoverflow.com/questions/675433/custom-colors-in-uitabbar – jonkroll Apr 06 '12 at 18:12
  • I think the link you gave talks about changing the background of the actual tabbar its self. I would like to change the background of the rest of the view. i.e. everything above the tab bar. – Jonnybellman Apr 06 '12 at 20:01

0 Answers0