I am building a NativeScript-Vue application and I am trying to add an image to the large iOS navigation bar. An example can be found here:
Add a button to large title navigation bar
And, exactly like the linked question I need the image to only be visible when the large titles are enabled. Fortunately there is a linked medium article which provides the solution.
However, I am having problems creating the UIImageView programmatically. Once I have managed to do this I think I will be able to convert the rest of the code.
I have tried the following:
- Using the UIImageView constructor, but it required arguments in an unknown form
- Creating a NS-Vue Image, but the
nativeViewproperty was undefined - Trying to hoist an already mounted image, but NativeScript threw errors
The NativeScript-Vue element that looks exactly what I need is as follows (however, I need to create the UIImageView with TypeScript instead):
<Image src="~/assets/images/users/eliottrobson.png" width="26" height="26"/>
This is the swift equivalent I am struggling to convert
private let imageView = UIImageView(image: UIImage(named: "image_name"))