Rohit
Rohit

Reputation: 196

SkinnableContainer+Layout vs Group+Rect+Hgroup

I'm trying to add a custom background to my horizontally laid out container. There are two ways mentioned to accomplish this:

  1. Use a SkinnableContainer with a HorizontalLayout
  2. Use a Group with a Rect and another HGroup inside it.

Which is a better option according to memory? Also, is placing multiple groups, hgroups and vgroups in a nested fashion a major flaw in design?

Thanks in advance!

Upvotes: 1

Views: 501

Answers (1)

JeffryHouser
JeffryHouser

Reputation: 39408

Which is a better option according to memory?

You'll have to test and see, but from a theoretical approach; a SkinnableContainer will perform a lot more processing than a group. My first approach would be to use a group with a Rect inside it. Or, if you're doing mobile development, use a group and draw a Rect on top of it using the graphics API.

Also, is placing multiple groups, hgroups and vgroups in a nested fashion a major flaw in design?

Not a major design flaw, but it could very well contribute to the lack of performance in an application. It it becomes an issue, you should evaluate your use of containers and see if you can minimize. Sometimes using a basicLayout and writing a layout algorithm will give you a lot more performance, and flexibility. It may very well take longer to write, depending on the complexity, though.

Upvotes: 1

Related Questions