开发者

Android antialiasing and pixel snapping

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜