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

added layoutSubviews supports #33

Closed
wants to merge 2 commits into from

Conversation

zhangao0086
Copy link

added layoutSubviews supports

@mdinacci
Copy link
Owner

Hello @zhangao0086

thank you for your contribution and sorry for taking so long to reply !
I noticed you included a file called MDRadialProgress.xccheckout and another called contents.xcworkspacedata which I believe are private files used by xcode and shouldn't be in the repository. Are there any reason why you think they should be committed ?

Regarding the other changes, can you explain why do you think layoutSubviews is necessary ?
The documentation has this to say:
Subclasses can override this method as needed to perform more precise layout of their subviews. You should override this method only if the autoresizing and constraint-based behaviors of the subviews do not offer the behavior you want. You can use your implementation to set the frame rectangles of your subviews directly.

I don't think we need to customise this behaviour, do you ?

@mdinacci mdinacci closed this Nov 21, 2014
@zhangao0086
Copy link
Author

Hi @mdinacci
When a MDRadialProgress instantiated from xib\storyboard with Auto Layout,if it's changed frame:
1
A MDRadialProgressLabel will not display correctly.

@mdinacci
Copy link
Owner

Hi @zhangao0086

thanks for the picture, I understand now. Your patch solves this problem but I think there is a more general issue to solve, which is making sure that MDRadialProgress work with Auto Layout. I will open an issue for that.

Thanks for taking the time to report this problem, I hope I can fix it in the coming week.

@mdinacci
Copy link
Owner

Hello again @zhangao0086

MDRadialProgressView already implements intrinsicContentSize which informs Auto Layout of the view size. Have you tried to set translatesAutoresizingMaskIntoConstraints = YES before modifying the frame ?

@zhangao0086
Copy link
Author

Hi @mdinacci
Yes, I set translatesAutoresizingMaskIntoConstraints = YES for MDRadialProgressView, but still does not work:
1
In my case, I use the MDRadialProgressView in UITableViewCell, the Cell reused in multiple UITableView, and they are not the same height.
I hope MDRadialProgressView able to adjust their frame according to the bounds of the Cell, and the MDRadialProgressLabel able to adjust their frame too.

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

Successfully merging this pull request may close these issues.

2 participants