Reputation: 1488
When im designing my android app im using XML and for this app im using the Relative layout but when i put the buttons on my screen with the png background i made its just looking bad.. the buttons are not put equaly like they should.. Look at this picture:
How would i solve so the pluss buttons and percent and comma and equal button will be placed right instead of looking all that weird?
If you are intrested to see my XML code here is an link for pastebin: http://pastebin.com/gpxnPT4P
Upvotes: 0
Views: 103
Reputation: 1091
I think you have to check the android:layout_...
of every item that is showing wrong. For example, the declaration for the number 5 button is:
<Button android:background="@drawable/number5" android:layout_marginLeft="5dp" android:layout_marginRight="5dp" android:layout_marginTop="5dp" android:layout_marginBottom="5dp" android:id="@+id/number5" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@+id/number8" android:layout_alignLeft="@+id/divided"></Button>
If you look closely the android:layout_alignLeft
declaration is pointing to de divide button (@+id/divided
) that is far away. There is a similar situation with the button for number 6.
Try this declaration for number 5 button:
<Button android:background="@drawable/number5" android:layout_marginLeft="5dp" android:layout_marginRight="5dp" android:layout_marginTop="5dp" android:layout_marginBottom="5dp" android:id="@+id/number5" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@+id/number8" android:layout_alignLeft="@+id/number4"></Button>
Hope this helps
Upvotes: 1