Android Question Border for webview

jazzzzzzz

Active Member
Licensed User
Longtime User
I need to put a border for my webview I tried this sample code but not working for webview.This works for imageview,panel and all

B4X:
Sub DrawBorder(Target As View, aColor As Int, StrokeWidth As Int)
   Dim c As Canvas
   c.Initialize(Target)
   Dim r As Rect : r.Initialize(0, 0, Target.Width - StrokeWidth, Target.Height - StrokeWidth)
   c.DrawRect(r, aColor, False, StrokeWidth)
   Target.Invalidate
End Sub
 

bgsoft

Well-Known Member
Licensed User
Longtime User
Hi

B4X:
    Dim Clrs(2) As Int
    Clrs(0) = Colors.White ' The one you want, not going to use
    Clrs(1) = Colors.White '  The one you want, not going to use
    GradientColor.Initialize("TL_BR",Clrs) '  The one you want, not going to use
    GradientColor.CornerRadius = 15dip  ' To round the corners

  Dim Panel1 as Panel
  panel1.Initialize("")
  panel1.Background = GradientColor
  Activity.AddView(panel1,0,0,100%x,100%y) 'The size of your webview

  dim webview1 as WebView
  dim webview1.Initialize(Event name)
  panel1.AddView(webview1,left,Top,100%x,100%y) 'The size of your webview

Regards
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…