Closed Manojkumarj closed 6 months ago
Any solution for this?
Hey, this can help! 😄
On your styles.tsx (or in the same file that you have your StyleSheet):
const {width} = Dimensions.get('window');
On buttonStyle
:
width: width / 4
-> Change for what you need
Hey, this can help! 😄
- On your styles.tsx (or in the same file that you have your StyleSheet):
const {width} = Dimensions.get('window');
- On
buttonStyle
:width: width / 4
-> Change for what you need
Is there any way to make the width adjust depending on the button text instead of using the same width for every option? (i'm showing the selected option on the button)
Hey, this can help! 😄
- On your styles.tsx (or in the same file that you have your StyleSheet):
const {width} = Dimensions.get('window');
- On
buttonStyle
:width: width / 4
-> Change for what you needIs there any way to make the width adjust depending on the button text instead of using the same width for every option? (i'm showing the selected option on the button)
I think you can have a state that stores the length of the selected option text, and pass that state to your styles.tsx. Instead of having width: width / 4
, you could have width: [some mathematical formula that you can use the state argument with the length of the selection option text]
That could solve the problem, but not sure, it could be worth trying! Let me know 👍
Fixed in v4.0 take a look at the changes made in v4.0 https://github.com/AdelRedaa97/react-native-select-dropdown?tab=readme-ov-file#-major-changes
Feel free to open the issue again if it still exists
Hi team, Can you please help us to fix the Dropdown Width adjustment based on the text issue in android and ios