3

I'm trying to get two MDCTextFields (https://material.io/develop/ios/components/textfields/) to stack vertically, one under the other without any spacing.

Here's a visual representation:

enter image description here

This is what it actually looks in the emulator altho they are constrained to stay close without margin/padding. MDCInputFields adds these spacings for label below each InputField. Is there a way to override this?

enter image description here

Constraint looks like this, top between email and password with constant 0 within a StackView set to Vertical. enter image description here

Rovdjuret
  • 1,458
  • 3
  • 19
  • 40

1 Answers1

0

1- Drag a UIStackView (vertical) , set centerX , top , width , height and set distribution to fillEqually , confirm spacing is 0

2- Drag the 2 textfields inside it without giving any constraints

3- Hook login button top constraint to the stack view's bottom + 20 and give it centerX

Shehata Gamal
  • 98,760
  • 8
  • 65
  • 87
  • Thanks for the suggestion, this does work with a normal UI component but not with MDCTextField. It seems to do something special under the hood at runtime that overrides whatever constraint I set. – Rovdjuret Jul 25 '18 at 12:57