Samjack
Samjack

Reputation: 188

Layout android, there are panels?

I'm not very experienced with android programming and I would like to know one thing. I would like to know if it was possible to set the layout of an application, in blocks. For instance now I use the layout as it was a frame in java, you can use the layout as the panels, as is done in java? Can I have more panels in the same layout?

Upvotes: 0

Views: 1547

Answers (3)

Kuffs
Kuffs

Reputation: 35651

Nesting layouts is unavoidable in Android. For instance the standard spinner widget is a textview and a button inside another layout.

The problem comes if you use nested weights. This can severely impact performance as each layout would need to be measured twice (3 times for a 3rd nesting level etc)

Upvotes: 0

Sound Conception
Sound Conception

Reputation: 5421

You can think of Views in android as being similar to Panels in java swing. Layouts like GridLayout, TableLayout, ReleativeLayout, LinearLayout etc allow you to add multiple Views to them. This is similar to adding Panels to a container in swing.

Upvotes: 2

Andrew Thompson
Andrew Thompson

Reputation: 168845

In my (very limited) experience of Android, I noted that Google strongly discouraged nesting layouts inside one another, citing (and this astonished me) 'performance'.

So the answer might be read as, 'yes it is possible, but it is not a good idea'.

Upvotes: 0

Related Questions