Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
Posts: 281
Registered: ‎05-31-2012
My Device: Playbook
My Carrier: o2
Accepted Solution

how to set the background color of a app in bbui.js?

how can i set the background color of a app which is using bbui.js?

 

its not working just to set a:

body {
	background-color: #000000;
}

 

Plase "+Like" my post if it was helpful.
Contributor
Posts: 14
Registered: ‎10-24-2012
My Device: BlackBerry Z10 Limited Edition
My Carrier: Globe Telecoms

Re: how to set the background color of a app in bbui.js?

I have the same issue back then with jQuery mobile. All you have to do is to target the "main" container of your <div>.

Example:

HTML:

<div id="main" data-role="page">
<div data-role="header">
<h1>Welcome to My Sample App!</h1>
</div>
<div data-role="content">
</div>
</div>

CSS:

#main
{
background: #000000;
}

Hope this technique works with bbUi.js. Happy Hacking! Smiley Happy
Core Member, PinoyBBDev
http://www.pinoybbdev.com
http://www.aaroncajes.com
http://www.twitter.com/aaroncajes
Developer
Posts: 142
Registered: ‎07-27-2011
My Device: Red Z10, 32GB PlayBook, Numerous Android/WP8/FirefoxOS/Other devices
My Carrier: T-Mobile

Re: how to set the background color of a app in bbui.js?

[ Edited ]

Find these lines in the bbui.css file and edit the white to the color you want:

 

.bb-bb10-lowres-screen {
font-size: 16pt;
position:absolute;
top:0px;
left:0px;
bottom:0px;
right: 0px;
background-color: white;
}

.bb-bb10-hires-screen {
font-size: 30pt;
position:absolute;
top:0px;
left:0px;
bottom:0px;
right: 0px;
background-color: white;
}

-----------------------------------------------------------------------------------------



Highlighted
Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: how to set the background color of a app in bbui.js?

It's even easier than that.. just set the style or class on your screen <div>

 

https://github.com/blackberry/bbUI.js/blob/master/samples/checkboxes.htm#L17

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Developer
Posts: 142
Registered: ‎07-27-2011
My Device: Red Z10, 32GB PlayBook, Numerous Android/WP8/FirefoxOS/Other devices
My Carrier: T-Mobile

Re: how to set the background color of a app in bbui.js?

I assumed he wanted to set the background for the entire app Smiley Happy but yes, if you just want to do it for a single page, definitely just edit the div.
-----------------------------------------------------------------------------------------