Uh oh!
There was an error while loading. Please reload this page.
[Android] Adding prop android_minWidth to Switch component - #29059
[Android] Adding prop android_minWidth to Switch component#29059fabOnReact wants to merge 10 commits into
Conversation
Base commit: e6fc20e |
Base commit: e6fc20e |
Uh oh!
There was an error while loading. Please reload this page.
dulmandakh
commented
Jun 7, 2020
why not support minWidth in style? |
HectorRicardo
commented
Jun 8, 2020
@dulmandakh that could also work, but I guess it is because the minimum width is only supported on Android and not on iOS, so by naming the property |
fabOnReact
commented
Jun 8, 2020
Thanks for the support @HectorRicardo Thanks and Sorry, but I do not work on iOS. I can not tell if this is possible or not. TLDR I did a brief research, this are my inconclusive results on iOS: on iOS we are using UISwitch as explained on stackoverflow
UISwitch*aSwitch= [[UISwitchalloc] initWithFrame:CGRectMake(120, 120, 51, 31)];
aSwitch.transform=CGAffineTransformMakeScale(2.0, 2.0);Seems difficult to change the width without using I personally would not use The iOS developer would have to find a way to set the I could not find existing iOS api to set the minWidth of a UISwitch, I did not make extensive research as I want to specialize on Android. Thanks a lot. |
HectorRicardo
commented
Jun 8, 2020
I also did some research, and although I don't have any Apple device to test, I am pretty sure the default UISwitch is not customizable. I suggest we leave the androidMinWidth attribute outside of the style object. |
Thanks a lot @dulmandakh for your code review. The main reason is that I am specializing on Android, Java and ReactNative/JS. It is harder for me to work with many different languages and tools. Thanks a lot |

Summary
This issue fixes#29047
Adding prop android_minWidth to Switch component.
Changelog
[Android] [Fixed] - Adding prop android_minWidth to Switch component
Test Plan
CLICK TO OPEN TESTS RESULTS
I will write separate pull request to update the docs on https://github.com/facebook/react-native-website