我在UIBuilder中创建了一个UIButton . 设置为“ Custom ”
在代码中我添加 Headers 和图像 . button works ,点击按钮后图像会发生变化 . But no text appears ?
btnAddRecord.SetTitle("Add Record",UIControlState.Normal);
btnAddRecord.SetTitleColor(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);
1 回答
你的语法看起来很怪异 .
试试
[button setTitle:@"Title" forState:UIControlStateNormal]