I am new in react native. I need to have a dropdownlist that read from a file.js. I used picker as below:
<Picker
style={Commonstyles.dropdownStyle}
mode="dropdown"
selectedValue={this.state.PickerValueHolderCity}
onValueChange={(itemValue, itemIndex) => this.setState({PickerValueHolderCity: itemValue})}>
{ console.log("mydataxxx", mydata) && this.renderPickerItemsCity(mydata)}
</Picker>
Everything works fine for me. My problem is that I need to apply a style with gray background and curve ages. However, it shows me just the gray background without curve border.
I used the following style for it:
dropdownStyle: {
//flex: 1,
backgroundColor: '#ecf0f1',
marginBottom: 7,
padding: 7,
alignSelf: "stretch",
// Set border width.
borderWidth: 1,
// Set border Hex Color Code Here.
borderColor: '#bdc3c7',
// Set border Radius.
borderRadius: 10 ,
// marginBottom: 10,
},
Can you please help me to apply the following style on picker. I should mention that, my style works fine on my textbox.
Definition and Usage. The border-radius property defines the radius of the element's corners. Tip: This property allows you to add rounded corners to elements! This property can have from one to four values. Here are the rules: Four values - border-radius: 15px 50px 30px 5px; (first value applies to top-left corner,...
In Xamarin.Forms, there is no Placeholder, BorderRadius, BorderColor, or BorderWidth for DatePicker Control. So in this article, we can learn how to set those properties for DatePicker using CustomRenderer. facebook. twitter.
Here are the rules: Four values - border-radius: 15px 50px 30px 5px; (first value applies to top-left corner, second value applies to top-right corner, third value applies to bottom-right corner, and fourth value applies to bottom-left corner):
Bordered Inputs. Use the border property to change the border size and color, and use the border-radius property to add rounded corners: First Name. Example. input[type=text] { border: 2px solid red; border-radius: 4px;}
Put your Picker inside a View
<View style={{borderRadius: 10, borderWidth: 1, borderColor: '#bdc3c7', overflow: 'hidden'}}>
and set the width of your Picker as the width of the View.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With