Use of Native UI elements


I am trying to understand how to use native UI elements in Nativescript in xml file.

I tried following inside a gridlayout.

<Button ios:text="I'm an iOS button!" android:text="I'm an Android button!" row="0" column="0" style.backgroundColor="green"> 
  <UIButton text="I'm an iOS button!"  row="0" column="1" style.backgroundColor="blue"> 

First button(green) does show up but not second one.
What am I doing wrong?

I am able to acess native componenents in my code :
e.g. private myIOSButton: UIButton;



UIButton is not a NativeScript widget so you can’t use that. If you rename <UIButton> to <Button> it will probably show up on iOS as well. Not on Android, because you’ve restricted it to only be included on iOS with those <ios> tags.


Yes, I am using iOS.

Thank you for the response.