Lost Password?

A password will be emailed to you. You will be able to change your password and other profile details once you have logged in.

Layout Problems Redux: Hierarchy Viewer

In the previous Building 'Droids post, we went through an exercise of figuring out what was going wrong with a RelativeLayout used as rows in a ListView. This exercise used "retro" diagnostic techniques, such as changing background colors, to see what's going on.

Two commenters, including Romain Guy from the Android team, pointed out the Hierarchy Viewer tool that has been added to the 0.9 SDK. So, today, let's see what this tool is all about and how it can help you make sense of your layouts as they are used.

To use the Hierarchy Viewer, you first need to fire up your emulator, install your application, launch your activity, and navigate to spot you wish to examine. For today's demonstration, we'll use a trivial activity, whose layout is shown below:

[sourcecode language="xml"]

android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">

Mark Murphy is the founder of CommonsWare and is the author of _The Busy Coder's Guide to Android Development_, _The Busy Coder's Guide to *Advanced* Android Development_, and _Android Programming Tutorials_.

Like this? Share it.

Related Posts

Ubuntu Ported To the Galaxy S II

  • 8

The Galaxy S II isn't even officially available yet in the US but it has already been rooted, overclocked and the first custom ROMs are coming up as well. I used to run Ubuntu on my original Galaxy S (Just for fun of course, like you can effectively use Ubuntu on a 4" screen), so I decided to port Ubuntu to the Galaxy S II. Read More »

How To Modify .apk Files

  • 13

The extension Google uses for Android applications may seem a bit complicated, but it really isn't. In fact, an .apk is nothing else than a .zip file disguised as an .apk. That makes things real simple. Read More »

0 Comments