iOS Question Round Button

MarcoRome

Expert
Licensed User
Longtime User
Hi all.
I have this in design
Corner Radius 50
Border 1



and this in Script General:

B4X:
'All variants script
AutoScaleAll


ScrollView1.SetLeftAndRight(0,100%x)
ScrollView1.SetTopAndBottom(0, 100%y - 90dip)

btn_ripeti.SetLeftAndRight(100%x - 70dip, 100%x - 10dip)
btn_ripeti.SetTopAndBottom(100%y - 70dip, 100%y - 10dip)

lbl_trascrivi.SetLeftAndRight(0,btn_ripeti.Left)
lbl_trascrivi.SetTopAndBottom(100%y - 50dip, 100%y)

lbl_indicazioni.SetLeftAndRight(0,btn_ripeti.Left)
lbl_indicazioni.SetTopAndBottom(100%y - 90dip, 100%y - 50dip)

But i have this "strain" effect ( already in preview in designer )



Any idea ?
Thanks
 

narek adonts

Well-Known Member
Licensed User
Longtime User
Upvote 0

BillMeyer

Well-Known Member
Licensed User
Longtime User
Ha - I was also caught like this and it is a very simple fix and you are going to kick yourself for the answer !!

To get a round button the corner radius you set in your designer must be half the width/height - in other words if your button is 80 x 80 then your corner radius must be 40 to give you a round button !!

In your case - your button is 60 x 60 - so your corner radius must be 30 !!

Don't kick too hard !!
 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
Yes is so . Well done and thank you
 
Upvote 0

BillMeyer

Well-Known Member
Licensed User
Longtime User
Don't worry guys - happens to all of us sometime !!
 
Upvote 0

Grant Fullen

Member
Licensed User
Oh I thought that the button size is set dynamicaly depending if the screen size

You're not wrong. If AutoScaleAll is on and changes the width/height of the button at all.....the corner radius value in the designer won't be exactly half anymore, therefore throwing it off. Setting it in code might be your only option.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…