I faced the problem when the text fits in container width. In that case I want the text just align on center by {textAlign: 'center'}. However this.setState({ animating: true }); is called even before this.calculateMetrics(); thus the static text with center aligned opacity is set to 0 and show ScrollView instead.
My proposal is to return promise from calculateMetrics, and instead of setTimeout we can chain then() to control what happens after.
I faced the problem when the text fits in container width. In that case I want the text just align on center by
{textAlign: 'center'}
. Howeverthis.setState({ animating: true });
is called even beforethis.calculateMetrics();
thus the static text with center aligned opacity is set to0
and show ScrollView instead.My proposal is to return promise from
calculateMetrics
, and instead ofsetTimeout
we can chainthen()
to control what happens after.I tried implementing this but not yet success, any help would be grateful.