JanPRO Well-Known Member Licensed User Longtime User May 2, 2015 #1 Hi, is there a way to only change the border color of a view? I already tried this: Code: Copy Dim no As NativeObject = Panel1 no.RunMethod("setBorderColor:",Array(no.ColorToUIColor(Colors.Magenta)))
Hi, is there a way to only change the border color of a view? I already tried this: Code: Copy Dim no As NativeObject = Panel1 no.RunMethod("setBorderColor:",Array(no.ColorToUIColor(Colors.Magenta)))
klaus Expert Licensed User Longtime User May 2, 2015 #2 Use simply the SetBorder(Width As Float, Color As Int, CornerRadius As Float) method. Upvote 0
JanPRO Well-Known Member Licensed User Longtime User May 2, 2015 #3 Yeaahh, I know this method. But I want to give users the option to change the whole app design, also the border colors. And for that I use the following loop: Code: Copy For Each v As View In Page_Main.RootPanel.GetAllViewsRecursive . . . If v Is Panel Then Dim pn As Panel = v 'Now I only want to change the color, and because I don't know the color witdh and the corner radius, I can't use SetBorder End If Next Edit: When I use this: Code: Copy no.GetField("layer").RunMethod("setBorderColor:",no.ColorToUIColor(Array(Colors.Magenta))) I get the following error: Unsupported type ^{CGColor=} Last edited: May 2, 2015 Upvote 0
Yeaahh, I know this method. But I want to give users the option to change the whole app design, also the border colors. And for that I use the following loop: Code: Copy For Each v As View In Page_Main.RootPanel.GetAllViewsRecursive . . . If v Is Panel Then Dim pn As Panel = v 'Now I only want to change the color, and because I don't know the color witdh and the corner radius, I can't use SetBorder End If Next Edit: When I use this: Code: Copy no.GetField("layer").RunMethod("setBorderColor:",no.ColorToUIColor(Array(Colors.Magenta))) I get the following error: Unsupported type ^{CGColor=}
klaus Expert Licensed User Longtime User May 2, 2015 #4 I gave you an answer to your question. Now it's another problem, never tried it that way. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User May 3, 2015 #5 You can use this code: Code: Copy Private Sub Page1_Resize(Width As Int, Height As Int) Dim no As NativeObject = SegmentedControl1 no = no.GetField("layer") SegmentedControl1.SetBorder(no.GetField("borderWidth").AsNumber, Colors.Red, _ no.GetField("cornerRadius").AsNumber) End Sub Upvote 0
You can use this code: Code: Copy Private Sub Page1_Resize(Width As Int, Height As Int) Dim no As NativeObject = SegmentedControl1 no = no.GetField("layer") SegmentedControl1.SetBorder(no.GetField("borderWidth").AsNumber, Colors.Red, _ no.GetField("cornerRadius").AsNumber) End Sub