Skip to content

Press events doesn't work in android when using padding  #138

@elirangoshen

Description

@elirangoshen

I using this library and in ios it works great but in android it doesn't trigger any press events, only when i cancel the padding in styles its working..

React Native version: 0.63.2
Android os version: 28
Lib version: 2.2.1

that the part of code I use :

 <SegmentedControl
          values={[Time.MORNING, Time.AFTERNOON, Time.EVENING]}
          selectedIndex={timeIndex}
          style={styles.timeContainer}
          fontStyle={styles.labelTime}
          activeFontStyle={styles.labelTimeActive}
          onChange={(event) => {
            setTimeIndex(event.nativeEvent.selectedSegmentIndex);
          }}
        />

const styles = StyleSheet.create({
  timeContainer: {
    backgroundColor: Colors.tonedDark,
    borderRadius: 100,
    marginTop: 12,
    paddingHorizontal: 16, // if i remove this and the other padding its working
    paddingVertical: 21, // if i remove this and the other padding its working
  } as ViewStyle,
  labelTime: {
    color: 'white',
    fontSize: 16,
    fontFamily: 'Tablet Gothic W02 Regular',
  },
  labelTimeActive: {
    color: '#000000',
    fontSize: 16,
    fontFamily: 'Tablet Gothic W02 Regular',
  },
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions