0
View에 배경 이미지 역할을 가진 UIImageView가 있습니다. Settings Bundle의 토글 스위치에서 선택된 상태에 따라이 UIImageView에서 두 개의 다른 이미지를로드하려고합니다.설정 번들의 토글 스위치 상태
가장 좋은 방법은 무엇입니까? 이 같은
View에 배경 이미지 역할을 가진 UIImageView가 있습니다. Settings Bundle의 토글 스위치에서 선택된 상태에 따라이 UIImageView에서 두 개의 다른 이미지를로드하려고합니다.설정 번들의 토글 스위치 상태
가장 좋은 방법은 무엇입니까? 이 같은
시도 뭔가 : 조언을
NSUserDefaults* settings = [NSUserDefaults standardUserDefaults];
NSString* imgName = [settings boolForKey:@"toggle_switch"] ? @"switch_on.png" : @"switch_off.png";
UIImage* img = [UIImage imageNamed:imgName];
[imageView setImage:img];
감사합니다! – Alex