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

Adobe AIR Development

Reply
Developer
Posts: 327
Registered: ‎12-13-2010
My Device: Bold 9900/Z10 Special Edition
My Carrier: Rogers

Drawing vs background

Alright so I've got a new project of which there will be a lot of "cells" (which means there will be bordered content cells of which cover the page (over 100)...Now I'm wondering what do you guys think would be best for the borders of these cells?

 

My options are to draw a ton of rectangles (drawRect), and lines etc... (probably 20 or so)

 

Or to do it as a background sort of image, and just overlay that with my cells and their clickable content, etc...

 

Thoughts?

CEO/Lead Developer - Tensioncore™ Design Studios
http://tncr.ws/ - ShortenThis!™ for Blackberry Playbook | ShortenThis!™ for BlackBerry® 10
The Periodical Toe A highly informative Table of Elements
DrawThis! A fun drawing app for the BlackBerry® PlayBook™!
http://www.tensioncore.com/ - Tensioncore™ Web Hosting
Developer
Posts: 382
Registered: ‎05-19-2008
My Device: BlackBerry Torch
My Carrier: AT&T

Re: Drawing vs background

If you don't need to have multiple colors on the border (ie to indicate a selected cell for instance) then allowing the backgroun to 'show through' the spaces between the cells is a fine approach. It also works well when considing an orientation change.

 

It can work too if the background were some sort of pre-generated nicely drawn image file as well, but getting the alignment set just right can be a very iterative and time-consuming process. Also, changing orientation may be more complicated as well.

 

On thing I've done is to generate a background (using graphics drawing commands, but it doesn't matter really) thats 1024x1024.  This way the background doesn't need to be redrawn or altered when the device changes orientation. If you can design your cell sizes and placement just right, you might be able to do something similar.

 

Bill
-------------------------------------------
Check out my book on BlackBerry Development for Java.
And my other really really old book
My Apps: FlashKids
Developer
Posts: 327
Registered: ‎12-13-2010
My Device: Bold 9900/Z10 Special Edition
My Carrier: Rogers

Re: Drawing vs background

I'm thinking I will restrict this particular app from changing orientation as it is very important to have the wide layout. The border will be purely a solid color, and on click of an individual cell other actions will happen after, so I won't need to highlight by selection
CEO/Lead Developer - Tensioncore™ Design Studios
http://tncr.ws/ - ShortenThis!™ for Blackberry Playbook | ShortenThis!™ for BlackBerry® 10
The Periodical Toe A highly informative Table of Elements
DrawThis! A fun drawing app for the BlackBerry® PlayBook™!
http://www.tensioncore.com/ - Tensioncore™ Web Hosting
Highlighted
Developer
Posts: 133
Registered: ‎12-02-2010
My Device: Z10 & Dev Alpha C
My Carrier: T

Re: Drawing vs background

How about using a list and laying it out using the tile layout.. In the item renderer of the list you can draw the cells borders.

 

Check out this..

http://blog.flexexamples.com/2009/03/25/setting-the-layout-direction-on-a-tile-layout-fxlist-control...

 

That uses images for the items but obviously you can change it to what ever you want.

---------------------------------------------------------------------
Developer of Stocks for Blackberry 10