iOS Question Only change border color

JanPRO

Well-Known Member
Licensed User
Longtime User
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)))
 
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:
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
 
Upvote 0
Back
Top