开发者

Android Surfaceview and different resolutions problem

开发者 https://www.devze.com 2023-03-11 23:29 出处:网络
I have encountered a weird problem and I can\'t manage a way to solve it. Scenario I have a Surfaceview on which I draw some images on different positions. First I created folders for l/m/hdip draw

I have encountered a weird problem and I can't manage a way to solve it.

Scenario

  • I have a Surfaceview on which I draw some images on different positions. First I created folders for l/m/hdip drawables and things worked fine. Then I decided to make only one folder drawable and let Android take care of the sizing. So I deleted the drawable-mdip and drawable-ldip folders, I moved all d开发者_JAVA百科rawable-hdip contents to drawable folder and run the application.

Problem

  • When resources were in drawable-hdip the surfaceview handeled the images as supposed to. Everything looked good and in place. After moving the hdip resources to drawable, everything on the surfaceview is oversized, it's like everything is at 130% zoom. I can't find a way to fix this because I can't find a reason why it makes this zoom. The test device is a Galaxy S so it should look good.

Any answer is greatly appreciated.


SurfaceView has problems with resizing images, so the best way for you to solve this problem is to create drawable folders for each resolution you want to target.

0

精彩评论

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