Citrrus / MBContactPicker

iOS7 Styled Contact Picker Library that uses a UICollectionView
MIT License
501 stars 60 forks source link

Add initWithFrame: implementation to MBContactPicker to support usage ou... #62

Closed mhupman closed 10 years ago

mhupman commented 10 years ago

...tside of a NIB context.

mhupman commented 10 years ago

@MattCBowman In need of your AutoLayout-fu. I think there is a constraint issue that needs to be taken care of before merging this in. It seems like if MBContactPicker is initialized with a frame of CGRectZero the contained MBContactCollectionView never expands when the frame of the container (the MBContactPicker) grows.

I was able to get the collection view to be visible if I removed the call to disable translatesAutoResizingMaskIntoConstraints on the MBContactPicker, which leads me to believe there is an implicit constraint we might be missing.

Take a look at f71dc6a, I put a demo of the issue and my temporary workaround there.

MattCBowman commented 10 years ago

:bug:

MattCBowman commented 10 years ago

If you want to manage layouts using frames, you'll need to turn on translatesAutoresizingMaskIntoConstraints on the MBContactPicker after initializing it. If you want to manage the layout manually, you can use constraints to place it in the proper location and size and not have to worry about turning on translatesAutoresizingMaskIntoConstraints.