Arsalan Sarwer
Posts: 0
Joined: Tue Oct 30, 2012 3:31 pm

Fit to the parent

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

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

Fit to the parent

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

Arsalan Sarwer
Posts: 0
Joined: Tue Oct 30, 2012 3:31 pm

Fit to the parent

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.

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

Fit to the parent

Hello!

Please try this one

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

Arsalan Sarwer
Posts: 0
Joined: Tue Oct 30, 2012 3:31 pm

Fit to the parent

Thank you, now it works fine

Return to “Issues”