mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-05 09:29:07 +08:00
Fix args passed when measuring Androidwitch
Summary: The first argument to `View.MeasureSpec.makeMeasureSpec` should be positive, but was being passed WRAP_CONTENT, which is negative. This diff fixes that. Reviewed By: achen1 Differential Revision: D6601683 fbshipit-source-id: 6d8499830f7b6da40848bab77d5ddbbb8a6fe44f
This commit is contained in:
committed by
Facebook Github Bot
parent
0cb59b5c23
commit
54e8d6cdc8
@@ -62,7 +62,7 @@ public class ReactSwitchManager extends SimpleViewManager<ReactSwitch> {
|
||||
ReactSwitch reactSwitch = new ReactSwitch(getThemedContext());
|
||||
reactSwitch.setShowText(false);
|
||||
final int spec = View.MeasureSpec.makeMeasureSpec(
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
0,
|
||||
View.MeasureSpec.UNSPECIFIED);
|
||||
reactSwitch.measure(spec, spec);
|
||||
mWidth = reactSwitch.getMeasuredWidth();
|
||||
|
||||
Reference in New Issue
Block a user