react-native-material-dropdown icon indicating copy to clipboard operation
react-native-material-dropdown copied to clipboard

feat: Add `labelStyle` prop to set advanced label styling

Open diosney opened this issue 5 years ago • 4 comments

As title says, styles like color, margin, paddings, and so on, would be very useful.

diosney avatar Jan 19 '20 00:01 diosney

Just pass your styles to inputContainerStyle={{your styles}}

farooqmajeed avatar Feb 05 '20 08:02 farooqmajeed

There is no prop called inputContainerStyle. The right prop is ContainerStyle and even this one doesn't change text styling on the label.

falcononrails avatar Aug 06 '20 13:08 falcononrails

There is inputContainerStyle, And it worked for me. Thanks @farooqmajeed

<Dropdown // ref={(input) => { this.slots = input; }} allowFontScaling={false} ref={this.slotsRef} style={{ // color:'blue',backgroundColor:'green', textColor: 'black', width: Platform.OS == 'ios' ? widthPercentageToDP("68%") : widthPercentageToDP("70%"), flexGrow: 1, flex: 0, alignItems: "center", // marginBottom: Platform.OS == 'ios' ? 8 : 0, marginLeft: Platform.OS == 'ios' ? 30 : 0,

              }}
              dropdownOffset ={{ top: 42 , left:50}}
              dropdownMargins={{ min: 21, max: 45, }}
              // dropdownPosition={ 2}
              overlayStyle={{marginTop:130}}
              // dropDownStyle={{backgroundColor: '#fafafa'}}
              value={this.state.selected_provider}
              onChangeText={(value, index) => {
                debugger
                const isWalletDropdownVisible = this.props.navigation.getParam(
                  'isWalletDropdownVisible'
                )
                this.props.navigation.setParams({
                  isWalletDropdownVisible: !isWalletDropdownVisible
                })
                this.slotChange(value, index) 
              }}
              label='Select a Practice'
              labelFontSize={25}
              inputContainerStyle={{marginLeft:30}}
              data={myFavouriteActors}
          />

kumarutsav111 avatar Sep 03 '20 12:09 kumarutsav111

inputContainerStyle only accepts ViewStyle properties like margin. You can try labelTextStyle for things like fontFamily and fontStyle.

theneekz avatar Sep 01 '21 15:09 theneekz