首先我表示這樣的UIAlertView中在我的視圖控制器(實在沒有什麼花哨的話):UIAlertView中標題標籤奇怪的背景顏色問題
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Thank you"
message:@"Successfully saved bookmark"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
但你可以在截圖中看到,標題標籤正在我認爲作爲其背景顏色的背景:
我還沒有的地方,這可能來自絲毫的想法,這裏是我怎樣稱呼我的視圖控制器出現時:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
self.title = @"Details";
[self.view styleBackgroundColor];
[self.saveToBookmarks configureButtonStyle];
[self.getDirections configureButtonStyle];
self.name.text = [simoItem name];
self.relativeLocation.text = [self relativeLocationStringForLocation:[simoItem location]];
self.address.text = [simoItem address];
self.type.text = [self buildTypesString];
[self.name styleMainLabel];
[self.address styleSubLabel];
[self.type styleSubLabel];
[self.relativeLocation styleSubLabel];
}
試圖清理項目,卸載從SIM應用程序和震動着我的電腦,但沒有什麼迄今所做吧...
編輯:根據要求
-(void) styleMainLabel {
//colors
UIColor *backgroundColor = [Utilities getBackgoundColorPreference];
UIColor *textColor = [Utilities getTextColorPreference];
[self setBackgroundColor:backgroundColor];
[self setTextColor:textColor];
//text size styling
self.font = [UIFont fontWithName:@"Tiresias PCfont" size:35.0];
self.adjustsFontSizeToFitWidth = YES;
}
可以顯示styleMainLabel的代碼。 – Jitendra
我覺得問題在這裏UIColor * backgroundColor = [Utilities getBackgoundColorPreference]; UIColor * textColor = [Utilities getTextColorPreference]; [self setBackgroundColor:backgroundColor]; [self setTextColor:textColor];請將其更改爲UIColor顏色名 – iEinstein
好了我解決了這個問題,這是由於在輔助功能事件回調中設置了一些CALayer顏色屬性。感謝您的幫助 – chopchop