Button and margins

176 views
Skip to first unread message

Serhei Scrabin

unread,
Mar 17, 2021, 8:43:46 AM3/17/21
to DroidScript
Hello everyone.
There is such a question.
In DroidScript, I place two buttons in the horizontal layout.
Why is there a small margin between them, even though padding and margins are set to 0?
What parameters are included in the width and height of the button?

Alan Hendry

unread,
Mar 18, 2021, 7:46:22 AM3/18/21
to DroidScript
Hi,
I believe the space between the text and the edge of the control is padding, and between controls is margin.
I tried settings on the layout, and on each button, still left a gap between them 
(even tried lay.SetChildMargins(0,0,0,0,0), and but1.Method("setPadding","int,int,int,int",0,0,0,0) - no difference).
I suspect this is built into Android (WebView). 
Until the Technical team can give a definitive answer you could try 
using Text boxes with SetBackColor and SetMargins - it works in my layouts
(you probably need to use OnTouchDown or OnTouchUp instead of OnTouch because Text boxes will call OnTouch for both down and up touches).
I've only just got Premium, so I know very little about Material UI (MUI), perhaps some-one could try that.
Regards, ah

Serhei Scrabin

unread,
Mar 18, 2021, 12:30:31 PM3/18/21
to DroidScript
Thanks


четверг, 18 марта 2021 г. в 14:46:22 UTC+3, hendr...@gmail.com:

Dave

unread,
Mar 18, 2021, 2:40:26 PM3/18/21
to DroidScript
The standard controls have small empty borders around them for drop shadows etc.

You could try negative margins and/or padding (might work)

Serhei Scrabin

unread,
Mar 19, 2021, 2:35:46 AM3/19/21
to DroidScript
Thanks.

четверг, 18 марта 2021 г. в 21:40:26 UTC+3, Dave:
Reply all
Reply to author
Forward
0 new messages