01-03-2013 03:31 AM
We are developing an application having screen with image in background and edit box. As soon as this screen displays, virtual keyboard gets launched (as default focus is on the edit box) and screen size gets changed due to which image in the background also gets shrinks (image gets disturbed).
Is there any work around or way to avoid screen sizing when virtual keyboard gets launched.
01-06-2013 06:29 AM
I presume you are using Display.getHeight() and Display.getWidth().
I recommend that you get these once, at application startup, and use this value where you need assets like images sized to the actual screen size.
You may need to be careful if you are supporting the application tilting the screen, as the width becomes the height and vice versa.
As I understand it, Display.getHeight() and Display.getWidth() are actually 'expensive' in terms of the resources required so doing this once is good practice.
If this doesn't help, look at how you are using sublayout in the Manager that you use to 'size' the background bitmap.
Finally if you are resizing things like this, I recommend that you do it once at application start-up (say while your splash screen is displaying) and save the images. This reduces the number of times you do this and may well reduce memory footprint, since images, especially background images, can be very large.