1

我有一个特定的高度晋升TableScreen,在细胞remote_image给出哈希和动作来处理水龙头:如何避免自来水remote_image尺寸变化在推广TableScreen

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),但会改变宽度以符合宽高比。

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

感谢, 本斯

回答

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 
}