开发者

iPhone UIButton to title text?

开发者 https://www.devze.com 2023-02-06 19:07 出处:网络
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?

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

精彩评论

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