English 中文(简体)
• 如何创造习俗,减少菜单
原标题:How to create custom dropdown menu react native

我想像以下的本土反应那样,制造一种下降的菜单。 请建议采取这种做法。

“entergraph

问题回答

仅安装react-native-popup-menu,并使用该软件,如 docs所解释。

可以通过使用react-native-elements与本法典(Just for 3 dots):

import { Icon } from  react-native-elements ;

.
.
.

  <Icon
      name={ dots-three-vertical }
      type={ entypo }
      size={20}
      color= #FFF 
  />

I think you can use Picker component from react native and for the details you can read picker documentation:

编码实例:

import {View,Text,Picker} from  react-native ;

 //in your render method
 return (
  <View>
   <Text}>Choose</Text>
    <Picker
       selectedValue={this.state.menu}
       onValueChange={(itemValue, itemIndex) => this.setState({menu:emValue})}
       mode="dropdown">
       <Picker.Item label="Add Note" value="addnote" />
       <Picker.Item label="Share" value="share" />
       <Picker.Item label="Vault" value="vault" />
     </Picker>
  </View>
 );

我希望这一答案能够帮助你。





相关问题
How to use one react app into another react app?

I have two react apps, parent app and child app. and child app have an hash router. I have build the child app using npm run build, It creates build folder. That build folder moved into inside the ...

how to get selected value in Ant Design

I want to print the selected value, and below is my option list: const vesselName = [ { value: 0 , label: ALBIDDA , }, { value: 1 , label: ALRUMEILA , }, { value: 2 ,...

How to add a <br> tag in reactjs between two strings?

I am using react. I want to add a line break <br> between strings No results and Please try another search term. . I have tried No results.<br>Please try another search term. but ...

热门标签