Complex Layouts

Posted: March 19, 2010 in Android
Tags: ,

I think one of the major misconceptions about Android layouts is that how to combine FrameLayout Relative and Linear layouts. Well, let me show you:

You can use FrameLayouts to overlap views. But when you start to embed other views and layouts there is a trick to it:

The main trick is to wrap your elements in a layout container as if you do not wrap it in a layout container the positioning layout parameters will default to FrameLayout parameter meanings, which is not what you want.

  1. Romain Guy says:

    Or you can simply use FrameLayout’s gravity. Wrapping children inside other layouts is not necessary sometimes.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s