question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Picker style is not working

See original GitHub issue

RN 0.55.4 “name”: “react-native-picker-select”, “version”: “3.1.1”,

<View style={{flex: 1}} >
    <Text style={{color: '#0082c6', fontSize: 16, fontWeight: 'bold', marginLeft: 5}}>SEXO</Text>
    <RNPickerSelect
        placeholder={{
            label: 'Seu Sexo',
            value: '',
        }}
        items={this.state.items}
        onValueChange={(value) => {
            this.setState({
                sexo: value,
            });
        }}
        style={{ backgroundColor: '#000' }}
    />  
</View>

I’ve tried to change the style to approximate the Picker box to the label “SEXO” but none type of styling is working. How to fix that?

Image to understand it better: img

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

93reactions
sturmentacommented, Jun 14, 2018

I use like this:

const pickerStyle = {
	inputIOS: {
		color: 'white',
		paddingTop: 13,
		paddingHorizontal: 10,
		paddingBottom: 12,
	},
	inputAndroid: {
		color: 'white',
	},
	placeholderColor: 'white',
	underline: { borderTopWidth: 0 },
	icon: {
		position: 'absolute',
		backgroundColor: 'transparent',
		borderTopWidth: 5,
		borderTopColor: '#00000099',
		borderRightWidth: 5,
		borderRightColor: 'transparent',
		borderLeftWidth: 5,
		borderLeftColor: 'transparent',
		width: 0,
		height: 0,
		top: 20,
		right: 15,
	},
};

<PickerSelect
	selectedValue={this.state.moreLessSelected}
	placeholder={{}}
	onValueChange={itemValue => this.setState({ moreLessSelected: itemValue })}
	style={pickerStyle}
	items={[
		{ label: 'More', value: '>' },
		{ label: 'Less', value: '<' },
	]}
/>

And working good 🤟🏻

37reactions
meliodevcommented, Feb 25, 2020

<RNPickerSelect … style={pickerSelectStyles} useNativeAndroidPickerStyle={false} // add this line and it should work />

Read more comments on GitHub >

github_iconTop Results From Across the Web

Date-picker styles not working after production build in Angular 4
Finally, I found a solution. I just added ngx-bootstrap CSS into angular-cli.json. angular-cli.json "styles": [ "styles.css", ".
Read more >
Picker Label not showing anymore | Apple Developer Forums
The Label for Picker is not being displayed anymore is there a way to fix this? The label used to show in earlier...
Read more >
why not working bootstrap date picker? - Laracasts
using bootstrap date picker plugin in Laravel app as following @extends('layouts.app') @section('content')
Read more >
Adding Styles to the React Date Picker - DevCamp
In the last video we set up our react date picker and we talked a little bit about ... That is interesting I...
Read more >
How to use react-native-picker-select - LogRocket Blog
Style objects such as inputAndroidContainer , inputAndroid , and placeholder are not available by default for the Android platform. However, you ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found