Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Underlyne style #102

Open
zvjerka24 opened this issue Jul 3, 2018 · 1 comment
Open

Underlyne style #102

zvjerka24 opened this issue Jul 3, 2018 · 1 comment

Comments

@zvjerka24
Copy link

If you put two AnimatedTextInput controls on the same screen and if all has the same custom style

        textinput2.style = LoginTextInputStyle()
        textInput1.style = LoginTextInputStyle()
        textInput1.backgroundColor = .yellow
        textinput2.backgroundColor = .green
        textInput3.style = LoginTextInputStyle()
        textInput3.backgroundColor = .red

where line height is defined in LoginTextInputStyle.

struct LoginTextInputStyle: AnimatedTextInputStyle {
   ...
    var lineHeight: CGFloat = 3
}

Style has been applied, but line height is correct only for the first text input, on others it is 0,5.

1

If apply custom style is moved to viewDidAppear, all of the text inputs has line height 0,5.

2

@zvjerka24
Copy link
Author

Just notice main reason for such behavior. It seems that layout constraints are not create right way, or not cleaned before new are created.

[LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x60c0002809b0 AnimatedTextInput.AnimatedLine:0x7fc82580f2b0.height == 0.5 (active)>",
"<NSLayoutConstraint:0x60800009fb30 AnimatedTextInput.AnimatedLine:0x7fc82580f2b0.height == 1 (active)>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x60800009fb30 AnimatedTextInput.AnimatedLine:0x7fc82580f2b0.height == 1 (active)>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant