Mike6730019
Posts: 0
Joined: Wed Mar 12, 2014 5:50 pm

Can we Automtically Change the screen size of the app?

Thanks for the quick reply. I revised the code as you have it here but the pages still only show up correctly on the 640x960 mobile preview. I tried both event 'load' and 'resize'. I must be missing a step somewhere?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Can we Automtically Change the screen size of the app?

Hi Mike - can you give us public link?

Mike6730019
Posts: 0
Joined: Wed Mar 12, 2014 5:50 pm

Can we Automtically Change the screen size of the app?

Sorry...pretty new on Appery. Is this what you need (link to preview?):

http://appery.io/app/mobile-frame?src...

I don't see an option to share a public link.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Can we Automtically Change the screen size of the app?

Thanks Mike we'll take a look, it's enough. How to make a public link you can check it here by the way: http://docs.appery.io/documentation/s...

Paul Steven Cue
Posts: 0
Joined: Thu Mar 13, 2014 2:47 am

Can we Automtically Change the screen size of the app?

Hi Mike,

what I also did is setting the dimensions of your width in %, so just calculate how much width you want for your image, and I set my height to just auto.

Paul Steven Cue
Posts: 0
Joined: Thu Mar 13, 2014 2:47 am

Can we Automtically Change the screen size of the app?

Image

Here's a sample image, I didn't do any CSS or JS with it. just that. Hopefully it works with you also.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Can we Automtically Change the screen size of the app?

Hi Mike -

Your app differ from Pauls.

You have background instead of an image.

That's why solution suggested from Paul not suitable for you.
You have to use following property:
pre
background-size: cover
/pre
You can read more about it here: http://www.w3schools.com/cssref/css3_...

So the right code for your app would be:
pre
Appery("mobilemain").css("background-size", "cover");
/pre

Mike6730019
Posts: 0
Joined: Wed Mar 12, 2014 5:50 pm

Can we Automtically Change the screen size of the app?

Thanks for the feedback. I tried a few things and worked with the background cover code above. Still can't seem to get it to fill the background in all instances. When I use the 'cover' code the image looks good on smaller screens but won't fill above 320x480 (won't fill vertically). Leave that line off and it looks good on the larger screens but not the smaller ones (image size stays constant). I removed all buttons and other elements so just need to lock in the one graphic. Have you come across this before? Thanks again.

http://appery.io/app/mobile-frame?src...

Mike6730019
Posts: 0
Joined: Wed Mar 12, 2014 5:50 pm

Can we Automtically Change the screen size of the app?

It seems to be working correctly in landscape mode but doesn't format for vertical.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Can we Automtically Change the screen size of the app?

Hello!

There are two ways:

1) Have two images for landscape and portrait mode and check with JS what image to show
2) Use prebackground-size: 100% 100%/pre in this case proportion won't be saved.

Return to “Issues”