Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
agnieszkabugla opened this issue Feb 24, 2020 · 3 comments
Open

Comments

@agnieszkabugla
Copy link

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',

    },
@iamacup
Copy link

iamacup commented Feb 24, 2020

I am pretty sure this is related to this: iamacup#42 (comment) which i have not found an elegant fix for on the table alignments, it would apply to any nested <Text> things though

@jimmi-joensson
Copy link

jimmi-joensson commented Nov 17, 2021

@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.

@pettertasolaving
Copy link

I have the same issue but with textAlign: 'right' on Android. It's a node of type 'text'. I try to set it by

<Markdown style={{ body: { textAlign: 'right', backgroundColor: 'red' } }} ... />

(at the moment just a dumb example trying to put align everything to the right). The background color indicates that the body indeed just wraps the text-element, so in a standard styling scenario this should work (and it does on iOS).

I realise that this is an old thread, but: Does anyone have any solution to this? I guess it wasn't related to your referenced issue @iamacup ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants