Android: Alignment of four squares

Posted by metter on Stack Overflow See other posts from Stack Overflow or by metter
Published on 2010-05-16T08:45:29Z Indexed on 2010/05/16 8:50 UTC
Read the original article Hit count: 189

Filed under:
|
|
|

Hello There

I am trying to align four equally sized squares on an Android Screen & I have now tried what feels like a million different approaches, yet none of them seem to work :(.

What I've got at the moment is the following:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 

android:id="@+id/MasterLayout" android:layout_width="wrap_content" android:layout_height="fill_parent" android:background="#FFFFFF">

<TableRow android:layout_weight="1"  android:background="#BBBBBB" android:padding="0dip">

<TableRow android:layout_weight="1" android:padding="0dip">

This basically does the job. However, every one of those four Images has a huge padding above and under it. How do I get rid of that? Or do I need to use a different Layout type alltogether?

To help illustrate my problem, here's a picture. On the left is what I got, on the right is what I need. Image

Thank you very much!

Cheers, Markus!

© Stack Overflow or respective owner

Related posts about android

Related posts about java