I want to set image and title for aUIButton. Here both are visible when I am using the background image for the button. But when I am using setImage Method then title is no longer visible.
[self setBackgroundColor:[UIColor clearColor]];
[self setTitleEdgeInsets:UIEdgeInsetsMake(0.0, 80.0, 0.0, 0.0)];
[self setTitle:@"Kansal Ji" forState:UIControlStateNormal];
[self setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
[self.titleLabel setBackgroundColor:[UIColor blueColor]];
[self setImage:[UIImage imageNamed:@"categories.png"] forState:UIControlStateNormal];
[self.imageView setBackgroundColor:[UIColor greenColor]];
[self setImageEdgeInsets:UIEdgeInsetsMake(0.0, 0.0, 0.0,kWidthOfView(self)-kHeightOfView(self))];
self.clipsToBounds = YES;
Please help regarding this.Here following code is done in the subclass of UIButton.