question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

<ios> and <android> tags do not work inside ActionBar

See original GitHub issue

There seems to be an issue when trying to use <ios> and <android> tags inside of an ActionBar that cause the app to crash.

 <ActionBar title="test">
      <ios>
          <ActionItem icon="res://ic_menu" ios.position="left" (tap)="openDrawer()"></ActionItem>
      </ios>
      <android>
          <NavigationButton icon="res://ic_menu" (tap)="openDrawer()"></NavigationButton>
      </android>
 </ActionBar>

However, outside of ActionBar this works.

<StackLayout class="mainStackLayout">
    <android>
        <Label [text]="mainContentText" textWrap="true" class="drawerContentText"></Label>
        <Button text="OPEN DRAWER" (tap)=openDrawer()></Button>
        <Button text="LIST VIEW" [nsRouterLink]="['/list']"></Button>
    </android>
    <ios>
        <Button text="ACCOUNT VIEW" [nsRouterLink]="['/account']"></Button>
    </ios>
</StackLayout>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
manojdcodercommented, Jun 13, 2017

@tsonevn When it is essential and often used, why don’t we ship it as built-in directive within NativeScript Angular package.

3reactions
bradmartincommented, Sep 13, 2017

@tsonevn - I won’t pretend to know all the details about angular or the integration. I’ve been working on several NG apps lately and coming from plain NS background I always default to <android> & <ios> tags for platform specific nodes in my templates. Is there reasoning this doesn’t work with the angular integration? What would it take to make this possible? After DevDays I wouldn’t mind working on helping get this done. I am thinking something like the directive @vakrilov has come up with should ship with the core and be available or support for the platform nodes similar to plain NS apps. At any rate, any info on concerns or limitations from the team are appreciated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Menu Items are not showing on Action Bar - android
Context. There seems to be a misunderstanding about this showAsAction property in the menu configuration. The information I find in the many stackoverflow ......
Read more >
Create Options Menu in ActionBar in Android using Jetpack ...
An ActionBar by default displays the activity name inside it. However, we can add other elements like the back button, images, options menu,...
Read more >
Menus - Android Developers
The action mode is disabled and the contextual action bar disappears when the user deselects all items, presses the BACK button, or selects...
Read more >
Using lists in Android wth ListView - Tutorial - Vogella.com
The input of a list (items in the list) can be arbitrary Java objects. The adapter extracts the correct data from the data...
Read more >
App bars: top - Material Design
A top app bar can transform into a contextual action bar, remaining active until ... iOS. Titles are center-aligned by default in navigation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found