简体   繁体   English

如何在 Monotouch 下在 iPhone 上设置按钮背景图像?

[英]How can I set a button background image on iPhone under Monotouch?

How can I set a button background image on iPhone under Monotouch?如何在 Monotouch 下在 iPhone 上设置按钮背景图像? It will be better if you provide me same sample.如果您提供相同的样品会更好。 Thanks.谢谢。

This will set a background image on a button:这将在按钮上设置背景图像:

button.SetBackgroundImage (UIImage.FromBundle ("imageFile"), UIControlState.Normal);

You can set different images for different control states with the UIControlState parameter.您可以使用 UIControlState 参数为不同的控件状态设置不同的图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM