April 3rd, 2012, 10:56 AM
Thread Author (OP)
Join Date: Nov 2010
Device(s): HTC Desire HD, Samsung Galaxy SII, Samsung Galaxy Nexus, ASUS Nexus 7
Carrier: Not Provided
Thanked 8 Times in 7 Posts
Remove widget margins in Relative layout?
Essentially as the title says.
I've built a widget; where I want one corner to be right up against the edge of the screen. It's a horizontal widget and made using a relative layout. It's the right hand side margin that I want right up against the screen edge. I've already tried the following:
This did move the entire widget closer to the edge but increasing the dp after that did nothing. It just stopped there, with a gap still there (albeit now a smaller gap).
I've tried using android:gravity. The background of this widget is a drawable shape with a button on it (coded via main.xml as normal). I've tried the above bits of code on both the drawable background XML and the main XML. Nothing works.
I'm sure there is an easy fix to this hence why I'm posting in Dev 101. Thanks in advance!