react-native-markdown-renderer icon indicating copy to clipboard operation
react-native-markdown-renderer copied to clipboard

TextAlign: center does not work in bold/strong element on Android

Open agnieszkabugla opened this issue 5 years ago • 2 comments

I have tried everything in custom styling, but nothing works on Android while on iOS single "textAlign: center" works without any problems

    strong: {
        fontSize: 18,
        color: Colors.darkBlueFont,
        fontFamily: Fonts.NunitoBlack,
        width: '100%',
        textAlign: 'center',
        margin: 'auto',
        display: 'flex',
        flex: 1,
        flexDirection: 'row',
        textAlignVertical: 'center',
        alignContent: 'center',
        alignSelf: 'center',
        alignItems: 'center',
        justifyContent: 'center',

    },

agnieszkabugla avatar Feb 24 '20 08:02 agnieszkabugla

I am pretty sure this is related to this: https://github.com/iamacup/react-native-markdown-display/issues/42#issuecomment-562199006 which i have not found an elegant fix for on the table alignments, it would apply to any nested <Text> things though

iamacup avatar Feb 24 '20 15:02 iamacup

@iamacup Seems the issue is due to the textgroup on Android not inheriting the common styles from body. Manually setting textgroup: { textAlign: 'center' } fixed the issue for me.

jimmi-joensson avatar Nov 17 '21 14:11 jimmi-joensson