3
我需要更改UIButton的alpha值,任何人都可以告诉我如何处理它。如何更改Iphone sdk中UIButton标题的alpha值?
而且按钮的代码,我写为:提前
UIView* buttonView = [[UIView alloc] initWithFrame:CGRectMake(10, 0, 100, 40)];
buttonView.backgroundColor = [UIColor clearColor];
backButton = [[UIButton alloc] initWithFrame:CGRectMake(5, 5, 100, 30)];
[backButton setBackgroundImage:[UIImage imageNamed:@"backbutton_100.png"] forState:UIControlStateNormal];
[backButton addTarget:self action:@selector(backAction:) forControlEvents:UIControlEventTouchUpInside];
[backButton setTitle:@" All Customers" forState:UIControlStateNormal];
backButton.titleLabel.font = [UIFont boldSystemFontOfSize:12];
[buttonView addSubview:backButton];
UIBarButtonItem* leftButton = [[UIBarButtonItem alloc] initWithCustomView:buttonView];
self.navigationItem.leftBarButtonItem = leftButton;
[leftButton release];
感谢。 Monish。
整个按钮或只是文本? – kennytm 2010-07-03 14:47:30
@Kenny:仅限于我想要更改Alpha值的文本。 – monish 2010-07-03 14:51:44