开发者

Android antialiasing and pixel snapping

开发者 https://www.devze.com 2023-01-29 10:09 出处:网络
I have a simple ListView with 1 dip border around cells. But depending on position they renders as 1 оr 2 pixel height. As I understand it is due to antialiasing - 1 dip line renders as 1 pixel only

I have a simple ListView with 1 dip border around cells. But depending on position they renders as 1 оr 2 pixel height. As I understand it is due to antialiasing - 1 dip line renders as 1 pixel only if it has precisely integer position. But in ListView scrolling position have floating point representation so line width jittering occurs during scroll even if cell heights are exactly integer.

Is there any way to do "pixel snapping" in such situation开发者_开发知识库?


Am guessing a bit, but your description sounds more like you have automatic scaling turned on (which it is by default). Suggest you try adding this tag as a child of your <manifest> tag in AndroidManifest.xml, if you haven't done so already.

<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:resizeable="true"
    android:anyDensity="true" />
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号