Align top two textviews with different font sizes
问题 Im using constraint layout and i want to achieve the following: The app:layout_constraintBaseline_toBaselineOf attribute bottom aligns the two textviews, is there any way to top align the two? The regular app:layout_constraintTop_toTopOf is not working of course because of the size differences. 回答1: So it seems there is no a convenient way of doing this and a custom view must be implemented. I've taken inspiration from here: https://github.com/fabiomsr/MoneyTextView 回答2: Try this . <?xml