iPhone UIButton to title text?
I have a UIButton created in UIBuilder. It is set to "Custom"
In code I add the title and images. The button works, images change on the click of the button. But no text appears?
btnAddRecord.SetTitle("Add Record",UIControlState.Normal);
btnAddRecord.Se开发者_StackOverflowtTitleColor(UIColor.White,UIControlState.Normal);
btnAddRecord.SetBackgroundImage (UIImage.FromBundle ("Images/lowerBarButton.png"), UIControlState.Normal);
btnAddRecord.SetImage (UIImage.FromBundle ("Images/lowerBarButton.png"), UIControlState.Normal);
btnAddRecord.SetImage (UIImage.FromBundle ("Images/lowerBarButtonEnabled.png"), UIControlState.Highlighted);
Your syntax seems really weird.
Try [button setTitle:@"Title" forState:UIControlStateNormal]
精彩评论