Skip to content

Latest commit

 

History

History
106 lines (101 loc) · 3.06 KB

PickerInput.md

File metadata and controls

106 lines (101 loc) · 3.06 KB

picker-input-headref

Picker Input

Include picker prop with <Item> to have picker type of input field.

Preview ios picker-input-headref Preview android picker-input-headref

Syntax

{% codetabs name="React Native", type="js" -%} import React, { Component } from 'react'; import { Container, Header, Content, Form, Item, Picker } from 'native-base'; export default class PickerInputExample extends Component { constructor(props) { super(props); this.state = { selected2: undefined }; } onValueChange2(value: string) { this.setState({ selected2: value }); } render() { return (

<Picker mode="dropdown" iosIcon={} {% raw %}style={{ width: undefined }}{% endraw %} placeholder="Select your SIM" {% raw %}placeholderStyle={{ color: "#bfc6ea" }}{% endraw %} placeholderIconColor="#007aff" selectedValue={this.state.selected2} onValueChange={this.onValueChange2.bind(this)} > <Picker.Item label="Wallet" value="key0" /> <Picker.Item label="ATM Card" value="key1" /> <Picker.Item label="Debit Card" value="key2" /> <Picker.Item label="Credit Card" value="key3" /> <Picker.Item label="Net Banking" value="key4" /> ); } } {%- language name="Vue Native", type="vue" -%}

<script> import React from "react"; import { Picker, Icon } from "native-base"; export default { components: { Item: Picker.Item }, data: function() { return { selected: "" }; }, methods: { onValueChange: function(value) { this.selected = value; }, getIosIcon: function() { return ; } } }; </script>

{%- endcodetabs %}