Skip to main content
 首页 » 编程设计

c#之在 MonoTouch.Dialog 中设置按钮颜色

2024年02月23日13mayingbao

我有以下代码:

[OnTap ("Account")] 
[Alignment (UITextAlignment.Center)] 
[Entry ("Create ScanDo! Account")] 
public string Login; 

我想根据另一个字段的内容动态设置单元格背景颜色,然后在单击按钮后设置。谁能给我一些样本指明方向?

谢谢, 瑞克

请您参考如下方法:

我想出的答案:

btnLogin = new StyledStringElement("", delegate {Account();}) 

要定义对象,将其添加到 RootElement,然后:

btnLogin.BackgroundColor = UIColor.Green; 

要设置颜色!这个方法让我设置颜色、字体、大小和标题。

Miguel,干得好,谢谢!