小编use*_*675的帖子

Foreach中的C#动作

fMethod是一个Action<Fruit>.

但是当fMethod调用时,参数始终是最后一个条目_Fruits.
怎么解决这个?

foreach(Fruit f in _Fruits)
{
   field.Add(new Element(f.ToString(),delegate{fMethod(f);}));
}
Run Code Online (Sandbox Code Playgroud)

c# foreach delegates action

5
推荐指数
1
解决办法
324
查看次数

Monotouch UITextField只有数字

我没有找到任何解决方案如何限制textfield只允许在Monotouch中的数字.

另外我希望那里不超过8个字符.

c# character uitextfield xamarin.ios

4
推荐指数
1
解决办法
3942
查看次数

标签 统计

c# ×2

action ×1

character ×1

delegates ×1

foreach ×1

uitextfield ×1

xamarin.ios ×1