Reputation: 21
I have a ProMotion TableScreen with specific height, remote_image given in cells hash and an action to handle taps:
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
}
Table is loaded with the image displayed in size of 60x60, however tapping the cell resizes the image and results in fixed height (60) but changed width to meet aspect ratio.
How can I avoid this resize? Is it possible to fix the image frame size without changing the image itself?
Thanks, Bence
Upvotes: 1
Views: 40
Reputation: 21
I found the solution to the problem that is related to selection_style. I had to change the cells hash to include selection_style: :none as follows:
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
}
Upvotes: 1