2015-01-30 2 views
1

내 앱의 배경 이미지를 설정하려고합니다. 내 ViewDidLoad에서이 코드를 사용하고 있습니다.패턴 이미지로 BackgroundColor를 iOS7에서 검은 색/투명 화면으로 설정합니다.

UIGraphicsBeginImageContext(self.view.frame.size); 
[[UIImage imageNamed:@"TablePlate"] drawInRect:self.view.bounds]; 
UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 
UIGraphicsEndImageContext(); 

self.view.backgroundColor = [UIColor colorWithPatternImage:image]; 

iOS8에서 실행하면 잘 작동합니다 (왠지).

아이디어가 있으십니까?

답변

2

그냥 대신 그래픽 문맥을 사용하는이 코드를 사용 : 배경 이미지 자체를 반복한다

- (void)viewDidLoad{ 
    [super viewDidLoad]; 

    self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"TablePlate"]]; 

} 
+0

. 버튼에 이미지를 완전히 채울 수있는 방법에 대해 언급 할 수 있습니까? –

관련 문제