i’m studying iOS programming. but i have a problem, which is opaque.
now assume. i have two image views.
when i write code, it works. code is here.
UIImageView *imageView1 = [[UIImageView alloc] initWithImage:@"something1"];
UIImageView *imageView2 = [[UIImageView alloc] initWithImage:@"something2"];
imageView2.opaque = NO;
[controller addSubView:imageView1];
[controller addSubView:imageView2];
now, imageView2 is on the imageView1. but imageView2’s property opaque set to NO.
so i can see imageView1 only. ok. that’s what i want.
but i want to do more easily. so i use interface builder.
i have two image views. one is wire up IBOutlet ImageView *imageView1
and another one is IBOutlet ImageView *imageView2.
and i set the imageView2’s inspector. and uncheck opaque.
and i build it. so i think it’s same effect as code above.
but imageView2 is on the imageView1.
it’s not disappear.
why is that?
why code can work but interface builder not?
UIView’s opaque property is used for determining whether the view can optimize compositing operations. You should be setting the alpha property.