Graphics Programs Reference
In-Depth Information
HypnosisView *anotherView = [[HypnosisView alloc] initWithFrame:anotherFrame];
[anotherView setBackgroundColor:[UIColor blueColor]];
Then, in
HypnosisView.m
, override
initWithFrame:
to set the background color
of every
HypnosisView
to clear.
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// All HypnosisViews start with a clear background color
[self setBackgroundColor:[UIColor clearColor]];
}
return self;
}
Build and run the application.
Figure 6.9
shows the clear backgrounds and the resulting
circles that look a little like an olive.
Figure 6.9 Current results