Settings: Show Layout Bounds

While implementing a complex UI layout in Android, it is very useful to get a good picture of the bounds (the border) of different components within the UI. For instance, if a relative layout’s position is modified programmatically, getting the bounds of the relative layout is useful. This helps in figuring out if a layout’s final position in the screen is in harmony with the expected position of the layout in the UI design. This also gives a good visual indicator of the distance between components when (say) RelativeLayout.below is specified.

In order to do this, turn on developer mode in Android. Then select Settings -> Developer Options -> Show layout bounds. This will draw blue rectangles on every UI component for all applications.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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