【问题标题】:iPhone UIButton to title text?iPhone UIButton 到标题文本?
【发布时间】:2011-06-13 22:45:27
【问题描述】:

我在 UIBuilder 中创建了一个 UIButton。它设置为“自定义

在代码中我添加了标题和图片。 按钮有效,点击按钮时图像会发生变化。 但没有出现文字

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);

【问题讨论】:

  • 这是什么语言..?
  • 它是 Microsoft.NET MonoTouch,允许用 c# 编写 iPhone 应用程序。

标签: iphone ipad xamarin.ios uibutton title


【解决方案1】:

你的语法看起来很奇怪。

试试[button setTitle:@"Title" forState:UIControlStateNormal]

【讨论】:

  • 这是用于 iPhone 的 MonoTouch。适用于 iPhone 平台的 C#.NET。
猜你喜欢
  • 2011-10-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-12-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-10-10
相关资源
最近更新 更多