0

I would like to do this

```xml

  <android>
      <NavigationButton 
                 text="Go Back"
                 android.systemIcon="ic_menu_more"
                 @tap="$refs.drawer.nativeView.showDrawer()"/>
  </android>

  <ios>
     <ActionItem 
            text="Menu" 
            @tap="$refs.drawer.nativeView.showDrawer()" />
  </ios>
</ActionBar>

```

What is the best way to go about it ?

1 Answer 1

1

As posted here https://github.com/nativescript-vue/nativescript-vue/issues/180#issuecomment-380844535

You can use these elements like you did, but the ActionBar is a bit different (hence why it doesn't work as you'd expect). What I've done in a project was to add

// main.js
import { isAndroid, isIOS } from 'tns-core-modules/platform';
Vue.prototype.$isAndroid = isAndroid;
Vue.prototype.$isIOS = isIOS;

In template

<ActionBar android.icon="ic_home" class="action-bar" title="Home">
         <NavigationButton 
                     v-if="$isAndroid"
                     text="Go Back"
                     android.systemIcon="ic_menu_more"
                     @tap="$refs.drawer.nativeView.showDrawer()"/>
         <ActionItem 
                v-else
                text="Menu" 
                @tap="$refs.drawer.nativeView.showDrawer()" />
</ActionBar>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.