B4J Question [ABMaterial]: Solved: How to not stretch the background image yet fill whole screen?

Cableguy

Expert
Licensed User
Longtime User
Set the gravity to center and make sure the image size is large enough to cover the whole screen
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Thanks @Cableguy , after much exploring, I figured out that perhaps if...

1. I dont set the SetBackgroundImage method on the page and
2. Add
B4X:
page.InjectCss($"body { background-image: url("../images/cont_bg.png") !important; background-repeat: repeat !important; }"$)

Passing the path to my image, it would work.

And it did. I guess I also need to learn some css things going forward.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…