zimennik
Posts: 0
Joined: Sat Jan 17, 2015 4:18 pm

Image resize problem

Hello. I have a problem.
I have background image with this CSS:

.workspace
{
background: url("images/back1.png") center;
background-repeat:no-repeat;
background-size:cover;
}

In web its look fine: Image

But when I building app for iOS I have some sort of this:
Image

And when I change phone orientation, background image not changing.
Please, help me with this.

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

Image resize problem

Hello!

Let me know if this helps http://devcenter.appery.io/documentat...

zimennik
Posts: 0
Joined: Sat Jan 17, 2015 4:18 pm

Image resize problem

Nope. Still have empty space between background and footer.

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

Image resize problem

Please try the following code on page Load

preApperyio("mobilecontainer1").css({
"background-image": "url(" + Apperyio.getImagePath("image.jpg") + ")",
"background-size": "cover"
})/pre
where image.jpg is the name of your picture. I've just tried and it worked for me.

zimennik
Posts: 0
Joined: Sat Jan 17, 2015 4:18 pm

Image resize problem

Sorry, I still have this problem.
On iOS screen seems fine, but i can scroll down and there is empty space before footer.
upd. Could this be because of that I use appery.io tester for iOS?

zimennik
Posts: 0
Joined: Sat Jan 17, 2015 4:18 pm

Image resize problem

Also, this how it's look on another device.
Image

There is a small space and scrollbar appering.

zimennik
Posts: 0
Joined: Sat Jan 17, 2015 4:18 pm

Image resize problem

I still have a problem. Please help!

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Image resize problem

Hi Zimennik,

It seems you try to apply background for wrong container.

Please try following js code:

pre

[data-role="content"]{
background: url(http://mypets.kiev.ua/sites/default/files/admin/59_13.jpg);
background-size: cover;
}

/pre

Regards.

zimennik
Posts: 0
Joined: Sat Jan 17, 2015 4:18 pm

Image resize problem

Thank you! I think this is it.
And one more, can I somehow call this component from javascript?

UPD.
Nope... Don't work.

Image

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Image resize problem

Hello Zimennik,

Could you please clarify, what exactly doesn't work - Yurii's approach?

Return to “Issues”