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

Unexpected layouting problem once using with UICollectionViewCell #16

Closed
fullc0de opened this issue Mar 28, 2017 · 4 comments
Closed

Unexpected layouting problem once using with UICollectionViewCell #16

fullc0de opened this issue Mar 28, 2017 · 4 comments

Comments

@fullc0de
Copy link

When I used NSLayoutAnchor to fit any view(named, myview) to contentView of UICollectionViewCell by using edges method like the following, myview is not resized but contentView is actually resized to fit to myview.

cell.contentView.addSubview(myview)
myview.edges(to: cell.contentView)

As I mention above, I expected that myview has same size of contentView. On the contrary, a size of contentView is affected by a size of myview.

On the other hand, using NSLayoutConstraint with Visual Format works well.

Is there anything what I don't know about NSLayoutAnchor?

@roberthein
Copy link
Owner

Mmmh 🤔 Let me look into this..
Could you provide a snippet of the actual code?

@roberthein
Copy link
Owner

Hi @fullc0de ,
I believe this issue was caused by different layout priorities between UIKit and TinyConstraints. The UIKit default priority is 1000 and the default of TinyConstraints was 750. I changed this to be the same as in UIKit in version 2.0 of TinyConstraints which I just released. 🚀
I hope this fixes your issue..

@fullc0de
Copy link
Author

fullc0de commented Apr 3, 2017

Hello, @roberthein
First of all, I'm sorry not to reponse quickly to your request.
Anyway, it works well as I expected. thank you for your work!!

@roberthein
Copy link
Owner

Thank you for pointing it out!

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

2 participants