1

I'm not able to figure out why my widget has an extra space on my phone desktop. It has extra space on top and on bottom. It would be graceful if somebody could help me, I've been struggling with this problem for 2 days now.

Here is my layout xml:

android:layout_height="130px" android:gravity="top" android:minHeight="130px" android:minWidth="152px" android:layout_marginBottom="-30px" android:layout_marginLeft="0px" android:layout_marginRight="0px" android:layout_marginTop="-30px" android:weightSum="0">

My layout should be 152px wide and 130px high!

I tried margin_top = -30px, in emulator it now shows fine, however when I install it on my phone that extra space is still there!

Kind Regards Raivis

Raivis
  • 11
  • 1

1 Answers1

0

It seems like your emulator screen is smaller than your phone screen.

Try using one item with a static size and the other one with fill_parent for the size. Then if you want spaces between the items you can use the layout margin's

Or you could make a custom view and override onLayout, onMeasure and onSizeChanged.

Then you can set the size in code.

Edit:
Try these in your XML

android:layout_height="fill_parent"
android:layout_width="fill_parent"
The Lazy Coder
  • 11,560
  • 4
  • 51
  • 69
  • Sorry, I'm kinda a beginner, I couldn't completely understand what I have to do. Kind regards. – Raivis May 01 '11 at 10:28