Setting background image...

Gary Miyakawa

Active Member
Licensed User
Longtime User
I'm trying to change the back ground image on both a ProgressBar and SeekBar view.

I've used the following code and the imageview1 does show the correct image, the others are not changed from their standard grey background.
What am I doing wrong ?

B4X:
   Activity.LoadLayout("1")
   Dim bmp As Bitmap
    bmp.Initialize(File.DirAssets, "abc.png")
    SeekBar2.SetBackgroundImage(bmp)
   seekbar4.SetBackgroundImage(bmp)
   imageview1.SetBackgroundImage(bmp)
   pbBar1.SetBackgroundImage(bmp)

Thanks,

Gary M
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Ok, that would explain it! Guess the documentation needs to be adjusted for that.

In the B4A Documentation Wiki, functions/properties common to all (or most) views are shown on one page; those unique to one (or a few) views are shown on the view's page. The Bitmap property does not appear on the common views page; it is on the ImageView page but not on the ProgressBar and SeekBar pages.

OTOH, the Common Views page does show:

Background As android.graphics.drawable.Drawable
Gets or set the background drawable.

and frankly, it's not clear to me exactly what that means. (I just copied it from the HelpViewer and futher searching didn't turn up a clear definition.)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…