Android Question B4XImageView with border

Andie

Member
Licensed User
Longtime User
I want a png-picture displayed with round corners and a colored border.
So, I picked B4XImageView as view type. And as this view is made of a panel named mBase, I tried:
B4X:
Private myImage As B4XImageView
.
myImage.Load(File.DirAssets, my_png_pic)
myImage.mBase.SetColorAndBorder(Colors.Cyan, 1%y, Colors.Magenta, 5%y)

But there was no effect at all. Do I miss something?
 

klaus

Expert
Licensed User
Longtime User
You can set the CornerRadius as property in the B4XImageView.
But the B4XImageView does not have a BorderWidth property.
The corner radius of mBase is set internally to the CornerRadius property value and the an Imageview is added onto it covering mBase.

The only workaround I see is to add a transparent Panel over the B4XImageView and set its CornerRadius, BorderWidth and BorderColor to your needs.
 
Upvote 1
Cookies are required to use this site. You must accept them to continue using the site. Learn more…