I don't know what you mean by "dynamic buttons", and I don't know about B4i, but in B4A you can set corner radius for buttons in the Designer. The corner radius persists if you resize the button in application code - not sure if that counts as being "dynamic".
I don't know what you mean by "dynamic buttons", and I don't know about B4i, but in B4A you can set corner radius for buttons in the Designer. The corner radius persists if you resize the button in application code - not sure if that counts as being "dynamic".
This is a big mistake to build the layout programmatically. Especially if you want to build a cross platform solution.
And make sure to handle the page resize event and reorganize the views.
B4XView.SetColorAndBorder allows you to set round corners and it is cross platform. In B4A, it will replace the gradient so you shouldn't use it. I think that it will keep the gradient with B4i. Try it.
In my project, at any instance, number of buttons are random so i have to create buttons programmatically. I have created sub to organize evenly over the screen and its working fine.
I have checked this for the cross platform. This allows rounded corner, however my conclusion is gradient can not be applied. Is there any way to apply gradient effect plus rounded corner for cross platform?
If needed, i can upload sample program from my project.
Dear Erel, I have tried this code in B4A to check it works or not (because i have not started to debug B4i). Background of Button is Transparent (gradient not applied).
It means, code given by Erel will work on B4i? Actually, i have not started to test B4i on my phone. I have recently bought B4i license, yet to bind with my Apple Developer account.
It means, code given by Erel will work on B4i? Actually, i have not started to test B4i on my phone. I have recently bought B4i license, yet to bind with my Apple Developer account.
Understood but Sorry, I am not still clear. i have two questions...
Question 1) In B4A, i have to declare Button as View and for B4i...Button as B4XView, is my understanding correct? like below...Button.Background is possible if Button is declared as View.
Code..:
Dim cd As GradientMaker
#if B4A
Dim Button As View
cd.Initialize
cd.SetGradient(Button, "LEFT_RIGHT",Array(xui.Color_Blue, xui.Color_Green))
Button.Background.As(GradientDrawable).CornerRadius=10dip
#Else If B4i
Dim Button As B4XView
cd.Initialize
cd.SetGradient(Button, "LEFT_RIGHT",Array(xui.Color_Blue, xui.Color_Green))
Button.SetColorAndBorder(xui.Color_Transparent, 2dip, xui.Color_Red, 10dip
#End If
Question 2) As i mentioned before, i have not activated Apple Developer Account, Just for the testing purpose, I applied Erel code (SetGradient + SetColorAndBorder) in B4A but it did not get gradient + rounded corner effect, will it support on iOS?