Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to style PickerField's Picker and PickerItem component #60

Open
nyanofthemoon opened this issue Sep 9, 2016 · 3 comments
Open

Comments

@nyanofthemoon
Copy link

Unable to style the react-native Picker and PickerItem components. I attempted to use the pickerWrapper, but only the backgroundColor can be changed this way and not the font family nor font size. Thanks!

@nyanofthemoon
Copy link
Author

pickercomponent_ios_js

@abologna-r7
Copy link

I believe you're looking for labelStyle prop.

screen shot 2016-10-17 at 5 20 44 pm

@dchersey
Copy link

dchersey commented May 27, 2020

For anyone else hitting this; I found that I needed to patch PickerComponent.ios.js#99 to include the itemStyle property for the RN Picker to style its items. Note that I used the valueStyle property because it worked for me but could easily have added another style prop or used labelStyle.

let picker = <Picker ref='picker'
        {...this.props.pickerProps}
        selectedValue={this.state.value}
        onValueChange={this.handleValueChange.bind(this)}
        mode='dropdown'
        **itemStyle={this.props.valueStyle}**
        >

I've also got a bunch of other patches that fix various iOS and android style and functional issues on my fork -- I have not processed them into a coherent PR yet and probably won't given that there's no activity on the outstanding PRs, one of which may conflict with mine.... but sharing it here in case others need them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants