所以我正在制作一个iPhone程序,由于一些奇怪的原因,我的UIButtons的标题不会显示......我错过了什么?
我没有错误甚至警告编辑和我的按钮和一切都出现,只是标题没有显示....
FurballViewController.m ... -(void)loadView { UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [btn setFrame:CGRectMake(20, 50, 280, 40)]; [btn setTitle:@"Stupid Title Wont Work" forState:UIControlStateNormal]; [self.view addSubview:btn]; [btn release]; } ...
答案 0 :(得分:0)
您是否尝试设置标题文字颜色?它可能是白色的。
答案 1 :(得分:0)
FurballViewController.m ... -(void)loadView { UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [btn setFrame:CGRectMake(20, 50, 280, 40)]; [btn setTitle:@"Stupid Title Wont Work" forState:UIControlStateNormal]; [self.view addSubview:btn]; //[btn release]; } ...