开发者

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]

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜