React native action bar and react native menu

后端 未结 3 1632
轮回少年
轮回少年 2021-01-06 05:09

I am new to React-Native and love it so far. I am trying to create a screen (for the cross-platform app) with a menu icon on top right and when clicked, I want to open a men

3条回答
  •  暖寄归人
    2021-01-06 06:00

    i use native-base library to create menu, this is the documentation. you can try to search component you needed

    https://docs.nativebase.io/Components.html#Components

    this is one example i tried to make a menu

    /** * Sample React Native App * https://github.com/facebook/react-native * @flow */

    import React, { Component } from 'react';
    import { AppRegistry } from 'react-native';
    import { Container, Content, Header, Body, Right, Button, Icon, Title, Drawer, Text } from 'native-base';
    
    class SideBar extends Component {
      render(){
        return(
          
              Account
              SignOut
          
        )
      }
    }
    
    export default class App extends Component {
      closeDrawer = () => {
        this.drawer._root.close()
      }
      openDrawer = () => {
        this.drawer._root.open()
      }
      render(){
        return(
           { this.drawer = ref; }}
            content={}
            onClose={() => this.closeDrawer()} >
              
                
    Header
    ) } } AppRegistry.registerComponent('Main', () => App);

    you can style your own menu. maybe it can help you, thanks :)

提交回复
热议问题