Assigning Image Views to Background image Of Button
<p>I am trying to combine two image views and put them into another image view which I am assigning to background image of a button.Somehow this is not working.Could someone please check and let me know what exactly is wrong here.      </p>

<pre><code>    UIImageView * image1 = [[UIImageView alloc] initWithImage:[UIImage    imageNamed:@"homesmall.png"]];
    UIImageView * image2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"update.png"]];

    [image1 setFrame:CGRectMake(16,0,16,16)];
    [image2 setFrame:CGRectMake(0,0,16,16)];

    UIImageView *cellAcc = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,32,16)];

    [cellAcc addSubview:image1];
    [cellAcc addSubview:image2];
    UIImage *image = [cellAcc image];

    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    CGRect frame = CGRectMake(0.0, 0.0, image.size.width, image.size.height);
    button.frame = frame;
    [button setBackgroundImage:image forState:UIControlStateNormal];
</code></pre>
