iOS設定背景圖片
阿新 • • 發佈:2019-02-03
UIImageView *customBackgournd = [UIImageView alloc] initWithImage:[UIImage imageNamed:@"background.jpg"]];
self.background = customBackground;
[customBackground release];
[self addSubview:background];
[self sendSubViewToBack:background];
2.
UIImageView *contentView = [UIImageView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
[contentView setImage:[UIImage imageNamed:@"background.jpg"]];
[contentView setUserInteractionEnabled:YES];
self.view = contentView;
[contentView release];
3.
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.jpg"]];