Panels with rounded corners?

BarrySumpter

Active Member
Licensed User
Longtime User
Hi all,

Just looking for a way to display a panel with rounded corners on top of a map.

Can I use the NinePatchDrawable on a panel to round its corners?

Or should I make the Panel an image.
Then use the ninpatchDrawable to round it corner?
The panle is slighly transparent.

tia
 

stefanobusetto

Active Member
Licensed User
Longtime User
the code for a button with rounded corners

Dim bt_src As Button

Dim cd As ColorDrawable
cd.Initialize ( Colors.Green , 5dip )

bt_src.Initialize("bt_src")
bt_src.Text = "..."
bt_src.Background = cd
...
 
Upvote 0

BarrySumpter

Active Member
Licensed User
Longtime User
WooHoo!

:sign0060:

Very nice!

Thanks for that help!

Requires OSMDroid library

B4X:
Sub Process_Globals
End Sub

Sub Globals

    Dim MapView1 As MapView
    
    Dim Panel1 As Panel
    
End Sub

Sub Activity_Create(FirstTime As Boolean)
    
    If File.ExternalWritable=False Then
        '    OSMDroid requires the use of external storage to cache tiles
        '    if no external storage is available then the MapView will display no tiles
        Log("WARNING NO EXTERNAL STORAGE AVAILABLE")
    End If
        
    'Activity.LoadLayout("")
    

    '    no EventName is required as we don't need to listen for MapView events
    MapView1.Initialize("")
    Activity.AddView(MapView1, 0, 0, 100%x, 80%y)
    
    '    by default the map will zoom in on a double tap and also be draggable - no other user interface features are enabled
    
    '    enable the built in zoom controller - the map can now be zoomed in and out
    MapView1.SetZoomEnabled(True)
    
    '    enable the built in multi touch controller - the map can now be 'pinch zoomed'
    MapView1.SetMultiTouchEnabled(True)
    
    '    set the zoom level BEFORE the center (otherwise unpredictable map center may be set)
    MapView1.Zoom=14
    MapView1.SetCenter(-37.85091702146988, 145.05743605518342)

  Panel1.Initialize("Panel1")
    Activity.AddView(Panel1, 40dip, 50%y, 270dip, 35dip)

    Dim cd As ColorDrawable
  cd.Initialize ( Colors.ARGB( 200, 0, 0, 0) , 5dip )

    Panel1.Background = cd 
    
End Sub


Sub Activity_Resume
End Sub

Sub Activity_Pause (UserClosed As Boolean)
End Sub
 
Last edited:
Upvote 0
Top