Lines between rows flickering

I have a tableView and between each row, I’ve made a line with strokeWidth 2 placed 2 pixels above the bottom of the row

When I scroll, the line widths change between 1 and 2, making it look like every line is flickering. 

Is there a way to make sure the line widths stay consistent while scrolling? What’s causing this behavior? 

Thanks! :slight_smile:

display.setDefault(“magTextureFilter”, “nearest”)
display.setDefault(“minTextureFilter”, “nearest”)

at the top of your program

I tried it out, but I there was no change with the lines - still changing widths while I scroll. The rest of my images decreased in clarity though

Are you using Tiled maps by any chance?

No, just a normal tableview.

Inserting rows and creating separator bars with

local separator = display.newLine (row, rowLeft, rowBottom - 2, rowRight, rowBottom - 2)    separator:setStrokeColor (.7,.7,.7)    separator.strokeWidth = 2

I’ve tried using an actual image of a line instead of 

display.newLine

Thinking it would render it differently, but the width is STILL varying while I scroll. Does anyone know why?

I’ve changed my .config scaling settings and the height and position of the image but to no avail.

*Solved*

It turns out it was the actual aspect ratio of my app that was causing the behavior. I couldn’t figure out how to fix this so I used a work around:

I wanted a line of strokeWidth 2, so I used a 4x4 image of the correct color and made the top and bottom pixels transparent. I scaled and placed the image. It still flickers, but only the top and bottom pixels are in danger of disappearing, and those are transparent so it looks perfect.

display.setDefault(“magTextureFilter”, “nearest”)
display.setDefault(“minTextureFilter”, “nearest”)

at the top of your program

I tried it out, but I there was no change with the lines - still changing widths while I scroll. The rest of my images decreased in clarity though

Are you using Tiled maps by any chance?

No, just a normal tableview.

Inserting rows and creating separator bars with

local separator = display.newLine (row, rowLeft, rowBottom - 2, rowRight, rowBottom - 2)    separator:setStrokeColor (.7,.7,.7)    separator.strokeWidth = 2

I’ve tried using an actual image of a line instead of 

display.newLine

Thinking it would render it differently, but the width is STILL varying while I scroll. Does anyone know why?

I’ve changed my .config scaling settings and the height and position of the image but to no avail.

*Solved*

It turns out it was the actual aspect ratio of my app that was causing the behavior. I couldn’t figure out how to fix this so I used a work around:

I wanted a line of strokeWidth 2, so I used a 4x4 image of the correct color and made the top and bottom pixels transparent. I scaled and placed the image. It still flickers, but only the top and bottom pixels are in danger of disappearing, and those are transparent so it looks perfect.