Page 1 of 1

Fit to the parent

Posted: Tue Oct 30, 2012 3:36 pm
by Arsalan Sarwer

when creating the splash screen, I used match_parent in motodev or eclipse, but in tiggzi, how can I define the width / height of the image, according to the mobile screen size.

On 320 x 480 it works fine, but less the resolution, it shows the scollbar.

Thank you


Fit to the parent

Posted: Tue Oct 30, 2012 4:22 pm
by Maryna Brodina

Hello! You can get to know Screen size with JS:

var screenWidth = $(window).width();
var screenHeight = $(window).height();

and then change img size for this width and height


Fit to the parent

Posted: Wed Oct 31, 2012 7:29 am
by Arsalan Sarwer

Hi,

I tried to change it and use this code;

var screenWidth = $(window).width();
var screenHeight = $(window).height();

var sp_img = Tiggr("splash_image");

sp_img.width=screenWidth;
sp_img.height=screenHeight;

I am running this script on load, but it doesn't change the image size.


Fit to the parent

Posted: Wed Oct 31, 2012 9:58 am
by Maryna Brodina

Hello!

Please try this one

sp_img.css("width", screenWidth);
sp_img.css("height", screenHeight);


Fit to the parent

Posted: Wed Oct 31, 2012 10:10 am
by Arsalan Sarwer

Thank you, now it works fine