Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example project layout problem #17

Open
ghost opened this issue Jan 29, 2014 · 3 comments
Open

Example project layout problem #17

ghost opened this issue Jan 29, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented Jan 29, 2014

Hi, I have just installed FLKAutoLayout. It looks powerful. But when I run example layout not always look same. Here is how example looks after run in simulator. Also when switch orientation, space between left and right view (views with dark grey colour as background) has random width. Here is one screenshot.
screenshot 2014-01-29 21 39 29

@ghost
Copy link
Author

ghost commented Jan 29, 2014

Sometimes when rotate there is red line (on right in picture below). This red colour is a background of UIWindow. I do not know why view of ALEViewController is sometimes resized (so red colour is visible).

update: I have add [self.view setTranslatesAutoresizingMaskIntoConstraints:NO]; to viewDidLoad and there is no anymore problem with red line,...but still have problem with textfields after launching app.
screenshot 2014-01-29 21 56 58

@rbarbera
Copy link

It also happens to me with the simulator and an iPad 2 running iOS 7.1.

The problem seems related to NSLayoutAttributeBaseline. if you try other layout attributes like NSLayoutAttributeBottom or NSLayoutAttributeCenterY the UITextView are correctly aligned with the UILabels.

@rbarbera
Copy link

Definitely it seems an Autolayout bug. I've reduced the sample to a bare minimum NSLayoutAttibuteBaseline test (https://gist.github.com/rbarbera/73dc24af0ad4477837bd). You can use [self buildWithFLKAutoLayout] method to build the UI using FLKAutoLayout methods or [self buildWithNSLayoutConstraint] to construct the same UI but using only Apple supplied APIs.

The results are the same: the textfields are misaligned for the first and last UITextField.
captura de pantalla de simulador ios 21 05 2014 10 05 50

orta added a commit that referenced this issue Apr 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant