hi,
if you would like to change the color of your Imageview.Bitmap than you could just
do it like this:
but it seems like that it is not working always (and on all devices like iphone 4)
so there is another option that worked for me:
Regards, ilan
EDIT: i dont know why the second code does worked for me and the first not. it seems like the build in b4i function does the same but it did not worked when i tried it on my iphone 4 and simulator. the second code did worked.
if you would like to change the color of your Imageview.Bitmap than you could just
do it like this:
B4X:
ImageView1.TintColor = Colors.RGB(Rnd(0,255),Rnd(0,255),Rnd(0,255))
but it seems like that it is not working always (and on all devices like iphone 4)
so there is another option that worked for me:
B4X:
Sub BmpColor(img As ImageView, color As Int)
Dim NaObj As NativeObject = Me
NaObj.RunMethod("BmpColor::",Array(img,NaObj.ColorToUIColor(color)))
End Sub
#If OBJC
- (void)BmpColor: (UIImageView*) theImageView :(UIColor*) Color{
theImageView.image = [theImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[theImageView setTintColor:Color];
}
#end if
Regards, ilan
EDIT: i dont know why the second code does worked for me and the first not. it seems like the build in b4i function does the same but it did not worked when i tried it on my iphone 4 and simulator. the second code did worked.
Attachments
Last edited: