1.0.8 • Published 8 years ago

react-native-flex-keyboard-spacer v1.0.8

Weekly downloads
1
License
ISC
Repository
github
Last release
8 years ago

react-native-flex-keyboard-spacer

This is keyboard-spacer for flex view. If you are anguished at hiding keyboard TextInput, this package makes you calm.

install

npm install react-native-flex-keyboard-spacer

demo

formspacerdemo

howToUse

See also demo codes.

class TextField extends Component {
    render() {
        const { style, label, spacerProps } = this.props;
        return (
            <View style={[styles.container, style]}>
                <Text style={styles.label}>{label}</Text>
                <TextInput {...spacerProps(this)} style={styles.textInput} />
            </View>
        );
    }
}

const App = (props) => {
    const { spacerProps } = props;
    return (
        <View style={styles.container}>
            <TextField spacerProps={spacerProps[0]} label="form1" style={{ flex: 4 }} />
            <TextField spacerProps={spacerProps[1]} label="form2" style={{ flex: 3 }} />
            <TextField spacerProps={spacerProps[2]} label="form3" style={{ flex: 2 }} />
            <TextField spacerProps={spacerProps[3]} label="form4" style={{ flex: 1 }} />
        </View>
    );
};

export default keyBoardSpacer({
    numbers: 4,
})(App);

API

keyboardSpacer

propertiesdefaultdescription
number0how many generate spacerProps
unTrackfalseif true, unTrackMode
androidfalseif false, this pkg not work on Android

unTrackMode

falsetrue
formspacerdemoformspacerdemo

spacerProps

<TextInput {...spacerProps(this)} style={styles.textInput} />
// spacerProps(this[, option])

option

propertiestypedescription
heightnumberextraHeight
1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago