Nativebase: Picker Item text Font family

Created on 1 May 2018  路  7Comments  路  Source: GeekyAnts/NativeBase

I use textStyle and itemTextStyle to change font family in Picker text item but doesn't work.
Can anyone help me?

<Picker
              mode="dropdown"
              selectedValue={this.state.selectedProvince}
              onValueChange={() => { }}
              textStyle= {{
                fontFamily: 'IRANSans'
              }}
              >
              {Object.keys(this.state.provinces).map((key) => {
                return (<Picker.Item label={this.state.provinces[key]} value={key} key={key} />)
              })}
</Picker>

and

<Picker
              mode="dropdown"
              selectedValue={this.state.selectedProvince}
              onValueChange={() => { }}
              itemTextStyle= {{
                 fontFamily: 'IRANSans'
              }}
              >
              {Object.keys(this.state.provinces).map((key) => {
                return (<Picker.Item label={this.state.provinces[key]} value={key} key={key} />)
              })}
</Picker>

All 7 comments

@alihesari checked this. Changing font family is working fine. Check whether the fontFamily is supported. Attaching a gif.

Gif
fontstyle

@akhil-geekyants Hi, I'm using a Persian font named IRANSans. This font does not work on Picker and worked on other tag such <Text>
Please open again this issue.

@alihesari tried with IRANSansWeb. Attaching a gif.

Gif

fontsupport

@akhil-geekyants Please see those images:
In these images you can the use of IRANSansWeb and IRANSansMobile for input and Picker.
IRANSansWeb and IRANSansMobile for input work correctly, but these two fonts for Picker are not working correctly. Why?
screen shot 1397-02-20 at 10 40 10 am
screen shot 1397-02-20 at 10 43 49 am

@akhil-geekyants It's not working on Android, I think this issue should reopen.

@akhil-geekyants You are testing Font-family on <Text> tag, but We have this problem in the <Picker> and <Picker.Item> for Android. 馃槃馃槂 Did you know what I mean?

@behzad888 Hi, Behzad I think this is a React Native problem on Android. Please read this #1885
Also you can use this https://github.com/sohobloo/react-native-modal-dropdown

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mcpracht picture mcpracht  路  3Comments

bsiddiqui picture bsiddiqui  路  3Comments

natashache picture natashache  路  3Comments

georgemickael-b picture georgemickael-b  路  3Comments

eggybot picture eggybot  路  3Comments