Search code examples
androidandroid-constraintlayout

ConstraintLayout space between Views


At the moment I'm playing a bit with the new ConstraintLayout and try to create the following layout:

enter image description here

(1) Headline: Type 24sp, Leading 32sp
(2) Subhead 1: Type 15sp, Leading 24sp
(3) 32sp line height
(4) 56dp padding between the top of button and the center of copy
(5) 24dp vertical padding

My problem now is that I do not know how I should handle the sizes which refer to the center of the second TextView. We do not have a constraint for the center (or baseline) to bottom or something like this. Also I'm not able to set a space between two views which are connected between the baseline points. So how should I create this layout with the ConstraintLayout?

Can someone please give me a sample layout from the picture above?


Solution

  • We only allow baseline to baseline, without margin for now. We might revisit this in the future, but as of ConstraintLayout alpha 7 you cannot do this. The only option is to align with top / bottom.

    enter image description here