1

我有一个具有特定高度的 ProMotion TableScreen,在单元格哈希中给出 remote_image 和一个处理水龙头的动作:

action: :my_action,
height: 80,
remote_image: {
      url: url, #this contains a valid url to random sized image
      placeholder: "icon.png",
      radius: 5,
      content_mode: :scale_aspect_fill
}

表格加载了以 60x60 大小显示的图像,但是点击单元格会调整图像大小并导致固定高度 (60) 但更改宽度以满足纵横比。

如何避免这种调整大小?是否可以在不更改图像本身的情况下固定图像帧大小?

谢谢,本斯

4

1 回答 1

1

我找到了与 selection_style 相关的问题的解决方案。我必须更改单元格哈希以包含selection_style: :none,如下所示:

action: :my_action,
height: 80,
selection_style: :none,
remote_image: {
  url: url, #this contains a valid url to random sized image
  placeholder: "icon.png",
  radius: 5,
  content_mode: :scale_aspect_fill
}
于 2015-10-16T10:20:16.190 回答