react-native-segmented-control icon indicating copy to clipboard operation
react-native-segmented-control copied to clipboard

Does not render correctly with flex

Open jamesholcomb opened this issue 2 years ago • 1 comments

      <View style={{ flexDirection: 'row' }}>
        <View style={{ flex: 0.5 }}>
          <SegmentedControl
            containerMargin={16}
            segments={['Label 1', 'Label 2']}
            onChange={(index) => setTabIndex(index)}
            currentIndex={tabIndex}
            badgeValues={[2, null, 1]}
          />
        </View>
        <View style={{ flex: 0.5, backgroundColor: 'red' }} />
      </View>

The calculation of the width seems to based on the device, not the the layout.

image

jamesholcomb avatar Mar 04 '22 03:03 jamesholcomb

I am also facing the same issue. Testing OS: Android

ahnafnafee avatar Apr 21 '22 17:04 ahnafnafee