Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

FBShimmeringView with translatesAutoresizingMaskIntoConstraints set to NO #21

Closed
pheuter opened this issue Apr 12, 2014 · 5 comments
Closed

Comments

@pheuter
Copy link

pheuter commented Apr 12, 2014

If I'm using Auto Layout on an FBShimmeringView, it doesn't seem to work. It appears to work only when initialized with an explicit frame.

This may be a non-issue and a necessary requirement of the library, but I'm just wondering if there are workarounds. I would like to center a shimmering view, and using rects isn't a great experience.

Thanks!

@grp
Copy link
Contributor

grp commented Apr 12, 2014

The latest commit should fix this. It's not yet available in Cocoapods, but could you let me know if it works with that commit manually included?

@pheuter
Copy link
Author

pheuter commented Apr 13, 2014

@grpaul Looks good on master 👍

@grp grp closed this as completed Apr 13, 2014
@barty82
Copy link

barty82 commented May 2, 2014

I'm still having a hard time with auto-layout, do I have to add set of constrains to 'FBShimmeringView' and its contentsView? Take a look at the image I'm attaching.

screen shot 2014-05-02 at 4 18 08 pm

@grp
Copy link
Contributor

grp commented May 2, 2014

You will need to make sure the shimmering view fills the full area you want
it to. However, you shouldn't need to adjust anything for the contentView
itself.

Sent from my iPhone

On May 2, 2014, at 4:19 PM, barty82 notifications@github.com wrote:

I'm still having a hard time with auto-layout, do I have to add set of
constrains to 'FBShimmeringView' and its contentsView? Take a look at the
image I'm attaching.

[image: screen shot 2014-05-02 at 4 18 08
pm]https://cloud.githubusercontent.com/assets/778043/2868842/16797cdc-d250-11e3-8305-8012b115cfcf.png


Reply to this email directly or view it on
GitHubhttps://github.com//issues/21#issuecomment-42088455
.

@barty82
Copy link

barty82 commented May 5, 2014

Take look at the image below,

screen shot 2014-05-05 at 10 58 50 am

This is the snapshot I took after I applied the Shimmer with auto-layout, as you can see the area of Shimmer view has shrank after I rotated the device, but the UILabel is still in the same size from the beginning.

This is the source code I tried.
screen shot 2014-05-05 at 10 59 06 am

Do you see any wrong implementation on my code?

Thank you for your quick respond anyways! ^^

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

No branches or pull requests

3 participants