【问题标题】:To get the size of image after requesting image asynchronously异步请求图片后获取图片大小
【发布时间】:2014-01-17 04:53:16
【问题描述】:

我使用 EGOImage 从远程异步请求图像。但是 EGOImageView 的 Size 是在请求​​之前分配的。问题是从远程请求的图像大小不同。那么可以调整 imageView 的大小或其他一些解决方案吗?

谢谢!

ps:EGOImage的使用方法:

imageView = [[EGOImageView alloc] init];
imageView.frame = oldFrame;
imageView.imageURL = [NSURL URLWithString:url];

【问题讨论】:

  • EGOImageView 是否具有在加载图像时触发的委托方法?如果有,那么您可以将图像视图的大小调整为该方法
  • @Ankush 谢谢!你应该在下面回答我,这样我才能接受你的回答!

标签: ios objective-c uiimageview uiimage


【解决方案1】:

要实现这一点,您可以使用委托方法imageViewLoadedImage。成功加载图像后,您的委托方法将被触发,您可以在此方法中调整 imageView 的大小。

【讨论】:

    【解决方案2】:

    EGOImageView 是否具有在加载图像时触发的委托方法?如果有,那么您可以将 imageview 的大小调整为该方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-03
      • 2014-02-14
      • 1970-01-01
      • 1970-01-01
      • 2012-01-06
      • 2019-03-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多