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

Native Development

Reply
New Developer
Falsetto
Posts: 6
Registered: ‎12-01-2012
My Device: Z10
My Carrier: Play

Coloured square

Hi, I'm wondering how make in the simplest way coloured square with colour set in RGB and contains onClicked option ?

Please use plain text.
Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: Coloured square

[ Edited ]

Hi,

Container {
  background: Color.create("#00ff00")
  onTouch: {
    if (event.isDown()) {
      // do something
    }
  }
}

 Untested, but should work.


Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Trusted Contributor
Brennan12325
Posts: 204
Registered: ‎05-15-2012
My Device: None
My Carrier: Telus

Re: Coloured square

You will probably need to add a preferredWidth and preferredHeight to that container or I suspect it will render with no size.

----------------------
Check out my app, Alien Flow for reddit

And of course, like my post if you found it helpful or informative!
Please use plain text.