Layers on a scrollview panel

barx

Well-Known Member
Licensed User
Longtime User
Is it possible to layer views on the panel of a scrollview?

Basically, I want a gradient background which I set with sv.panel.background and that works ok, I then want a imageview which will be full screen size and added to the sv.panel, then on the top a label holding some text.

So the question is can the imageview and the label be layered?

I'm using this code but the imageview isn't showing

B4X:
   bgImg.Initialize("")
   
   If 100%x > 100%y Then 
      bgImg.Bitmap = LoadBitmap(File.DirAssets, "bg-horizontal.png")
      svContent.Panel.AddView(bgImg, 0, 0, 100%x, 100%y)
   Else
      bgImg.Bitmap = LoadBitmap(File.DirAssets, "bg-vertical.png")
      svContent.Panel.AddView(bgImg, 0, 0, 100%x, 100%y) 'Added in IF statement as the exact x, y, will be tweaked.
   End If
   
   svContent.Panel.AddView(lblContent, 10dip, 10dip, (100%x - 20dip), 10dip)
 

barx

Well-Known Member
Licensed User
Longtime User
Solved:

The above code was fine, I needed to set the Gravity to Gravity.Fill (most of the img is transparent)

Is it just me that can spend forever trying to solve an issue, finally give up and ask on the forum only to solve it minutes later....
 
Upvote 0
Top