我需要同步使用FFImageLoading ImageService类的CreateCell方法,因为它是在网格数据源的CreateCell方法中调用的。使用Xamarin.iOS和c#。感谢一个快速的解决方案。以下是当前代码:
public override IGFlowLayoutViewCell CreateCell(IGFlowLayoutView flowLayoutView, nint index)
{
IGFlowLayoutViewCell cell = flowLayoutView.DequeueReusableCell("CELL") as IGFlowLayoutViewCell;
UIImageView iconImage = new UIImageView();
if (cell == null)
{
cell = new IGFlowLayoutViewCell("CELL");
cell.ContentInset = new UIEdgeInsets(2, 2, 2, 2);
cell.ContentMode = UIViewContentMode.Center;
cell.Layer.BorderColor = UIColor.LightGray.CGColor;
cell.Layer.BorderWidth = 1;
cell.ContentView = iconImage;
ImageService.LoadUrl(instrumentImageUrls[index], new TimeSpan(12, 0, 0))
.Into((UIImageView)cell.ContentView,0);
}
return cell;
}发布于 2017-01-02 23:18:24
public override IGFlowLayoutViewCell CreateCell(IGFlowLayoutView flowLayoutView, nint index)
{
IGFlowLayoutViewCell cell = flowLayoutView.DequeueReusableCell("CELL") as IGFlowLayoutViewCell;
UIImageView iconImage = new UIImageView();
if (cell == null)
{
cell = new IGFlowLayoutViewCell("CELL");
cell.ContentInset = new UIEdgeInsets(2, 2, 2, 2);
cell.ContentMode = UIViewContentMode.Center;
cell.Layer.BorderColor = UIColor.LightGray.CGColor;
cell.Layer.BorderWidth = 1;
cell.ContentView = iconImage;
ImageService.LoadUrl(instrumentImageUrls[index], new TimeSpan(12, 0, 0))
.IntoAsync((UIImageView)cell.ContentView,0).GetAwaiter().GetResult();
}
return cell;
}https://stackoverflow.com/questions/37076284
复制相似问题