【问题标题】:UIImageView, when in a XIB, uses which UIImage method?UIImageView 在 XIB 中使用哪个 UIImage 方法?
【发布时间】:2012-10-31 19:28:16
【问题描述】:

据我所知,XIB 中的UIImageViews 不使用+imageNamed。我也试过+imageWithContentsOfFile,但这也不是骰子。

Interface Builder XIB 使用哪种 UIImage 方法在 ImageViews 中加载图像?

【问题讨论】:

  • 我也想知道这个。我只是想调整 imageNamed 函数,以便它自动加载 ~568h 图像,但这不适用于 XIB 文件中定义的图像。
  • initWithCoder:,乱来很烦。

标签: iphone ios uiimageview uiimage interface-builder


【解决方案1】:

请参阅下面给出的链接,它可能会对您有所帮助。很可能第三个答案会帮助你,

How can I change the image displayed in an UIImageView programmatically?

在XIB中设置图像时应该触发最后一个方法

    [YOURCONTROLLER.imageToDisplay setImage:[UIImage imageNamed:value]];

【讨论】:

    猜你喜欢
    • 2012-03-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多