triniwiz / nativescript-popup

Apache License 2.0
22 stars 17 forks source link

ActionBar ActionItem #14

Open dottodot opened 5 years ago

dottodot commented 5 years ago

Which platform(s) does your issue occur on?

For some reason it doesn't seem possible to have the popup attached to an ActionItem like below

<ActionBar title="Projects" class="action-bar">
  <StackLayout orientation="horizontal" ios:horizontalAlignment="center" android:horizontalAlignment="left">
    <Image src="res://logo" height="32"></Image>
  </StackLayout>
  <ActionItem id="menu" text="Options" ios.position="right" (tap)="showMenu()"></ActionItem>
</ActionBar>

However it seems like you can put a Label inside an ActionItem with an id and that will work.

<ActionBar title="Projects" class="action-bar">
  <StackLayout orientation="horizontal" ios:horizontalAlignment="center" android:horizontalAlignment="left">
    <Image src="res://logo" height="32"></Image>
  </StackLayout>
  <ActionItem ios.position="right" (tap)="showMenu()"><Label id="menu" text="Options"></Label></ActionItem>
</ActionBar>

Not sure if this is a bug or not, but at least this will help anyone else that comes across this problem.

rob4226 commented 3 years ago

Thank you! The label trick saved me!! I wonder why it doesn't work directly on an ActionItem?