I'm quite new to react-native css-styling.. and have the following code:
<Text>
<Text style={(styles.author, { textAlign: "left" })}>
{question.view_count + " views\t" + question.comment_count}
{question.comment_count > 1 || question.comment_count == 0
? " comments"
: " comment"}
</Text>
<Text style={{ textAlign: "right" }}>
{question.solution_count > 0
? question.solution_count + " solutions"
: " Solve this"}
</Text>
</Text>;
The problem is the second "textAlign: 'right' " isn't working - the text is still on the left. I want the text to be on the same line, but (obviously) the second text-object on the right.
Any hints? thanks!
<Text style={styles.author, {textAlign: 'left'}}>
should actually be<Text style={[styles.author, {textAlign: 'left'}]}>
you need to put overriding styles in an array, with the second item overriding the first :)