Page 1 of 2

How do I keep the images and labels the same size through out different screen sizes?

Posted: Tue Nov 26, 2013 8:34 pm
by adam griffin

I am using a grid to keep images and labels align. When I change screen sizes the grid remains the same but the alignment of the images with the labels begin to part further apart. How can I keep the spacing between the two the same no matter what the screen size is? Image Image


How do I keep the images and labels the same size through out different screen sizes?

Posted: Tue Nov 26, 2013 8:35 pm
by adam griffin

I'm sorry i said sizes I meant spacing.


How do I keep the images and labels the same size through out different screen sizes?

Posted: Tue Nov 26, 2013 9:42 pm
by Maryna Brodina

Hello! Try to set center alignment for grid cell.


How do I keep the images and labels the same size through out different screen sizes?

Posted: Tue Nov 26, 2013 10:19 pm
by adam griffin

I don't see that option when I click on the grid cell. I have the labels within each cell centered, I don't see anything saying center alignment in the grid cells. Is there any other way?


How do I keep the images and labels the same size through out different screen sizes?

Posted: Tue Nov 26, 2013 10:23 pm
by Igor

Hello,
You can use CSS to set alignment. Please take a look at this doc http://docs.appery.io/documentation/w...


How do I keep the images and labels the same size through out different screen sizes?

Posted: Tue Nov 26, 2013 10:25 pm
by adam griffin

Im sorry, but Im not familiar with CSS.


How do I keep the images and labels the same size through out different screen sizes?

Posted: Tue Nov 26, 2013 11:14 pm
by maxkatz

We can give you guidance, tips, etc, but CSS knowledge is required for customizing your app. http://docs.appery.io/getting-started...


How do I keep the images and labels the same size through out different screen sizes?

Posted: Wed Nov 27, 2013 2:58 pm
by Ram

@Adam

here's my solution to that problem, this is the page in design mode:
Image

this is the code attached to the button (you should use it in page load event):
precode
var imgH = Appery('mobileimage_9').height();
var imgW = Appery('mobileimage_9').width();
//alert(h);
var cellElement = Appery('mobileimage_9').closest('td');
var clH = cellElement.height();
var clW = cellElement.width();

var imgLeft = (clW - imgW) / 2;
var imgTop = (clH - imgH) / 2;
Appery('mobileimage_9').css('position', 'relative').css('top',imgTop).css('left',imgLeft);
Appery('mobileimage_10').css('position', 'relative').css('top',imgTop).css('left',imgLeft);
/code/pre

once run before running the code:
Image

now, after running the code:
Image

different screen size before running the code:
Image

different screen size after running the code:
Image

i'm sure there are other ways to get this done but this does the work for me.
Best,
R.


How do I keep the images and labels the same size through out different screen sizes?

Posted: Fri Nov 29, 2013 11:20 pm
by adam griffin

Thats exactly what I needed! I am going to see will it work for me.


How do I keep the images and labels the same size through out different screen sizes?

Posted: Fri Nov 29, 2013 11:26 pm
by adam griffin

what is the "td" in - var cellElement = Appery('mobileimage_9').closest('td');