I'm trying to set a background image to a label using Native object as in the attached project, but get a -[NSMethodSignature getArgumentTypeAtIndex:]: index (2) out of bounds [0, 1] error.
According to code I've found it should work simply as:
UIColor is created as a <B4INativeObject: kCGColorSpaceModelPattern 1 > object, but it won't assign using the "backgroundColor" property.
Am I using the Native Object correctly?
According to code I've found it should work simply as:
B4X:
UIColor *color = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image.png"]];
label.backgroundColor = color;
UIColor is created as a <B4INativeObject: kCGColorSpaceModelPattern 1 > object, but it won't assign using the "backgroundColor" property.
Am I using the Native Object correctly?
B4X:
Dim img As Bitmap
img.Initialize(File.DirAssets,"IconBackground (10).png")
Dim NObj,UIColor As NativeObject
UIColor.Initialize("UIColor")
UIColor = UIColor.RunMethod("colorWithPatternImage:",Array(img))
Log(UIColor)
NObj = Label1
NObj.RunMethod("backgroundColor",Array(UIColor))