Code:
UIButton *btnSignOn = [UIButtonbuttonWithType:UIButtonTypeCustom];
btnSignOn.frame = CGRectMake(100, 100, 150, 150);
btnSignOn.center = CGPointMake(175, 175);
[btnSignOn addTarget:selfaction:@selector(buttonSignOn:) forControlEvents:UIControlEventTouchUpInside];
btnSignOn.backgroundColor = [UIColorbrownColor];
[btnSignOn setTitle:@"GOOD"forState:UIControlStateNormal]; //button上CurrenTitle显示为GOOD
// btnSignOn.titleLabel.text = @"btnSignOn"; //
// btnSignOn.titleLabel
// btnSignOn.titleLabel.textColor = [UIColorredColor];
btnSignOn.tintColor = [UIColorgreenColor];
[self.view addSubview:btnSignOn];
[btnSignOn release];
currentTitle 和titlelabel 不一样。按钮上显示的是CurrnetTitle,而不是titlelabel。
http://sandfly.net.nz/blog/2010/02/uibutton-titlelabel-is-not-as-useful-as-it-looks/