我在使用UILabels構建的iOS應用程序中遇到問題:儘管初始化它們,但我編程的文本不會顯示出來,而且我正在智慧地結束我應該做什麼。UILabel文本將不會顯示
例如,這是應用程序的屏幕之一,我有這樣的問題:
Welcome.m
@interface Welcome()
@end
@implementation Welcome
-(void) viewdidLoad{
[super viewDidLoad];
UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 140, 47)];
[self.view addSubview: label];
label.text = @"Benvinguts a la pràctica de iOS I";
label.numberOfLines = 4;
}
-(IBAction) buttonPressed: (id) sender
{
[self performSegueWithIdentifier:@"Tutorial1" sender:self];
}
@end
你能幫助我在解決這個?
textLabel.textColor =的UIColor blackColor ]。 – JSA986
'歡迎''viewController'甚至加載?在'-viewdidLoad:'上放一個斷點,並檢查你的應用程序是否流入這個方法。 – staticVoidMan
它可能是菜單欄(在iOS7中)顯示「隱藏」文本的問題? – Larme