Q: Moving a custom UIView, the subview is not following I have created a view with buttons to collect feedback that I want to reuse in many places in my application. It is suppose to slide up from the bottom.
This is what I have done:


*

*Created the FeedbackView.xib

*Setting the file's owner as the FeedbackView

*In FeedbackView.h I have created an outlet contentsView to the root view in the .xib file

*I write the following in the Feedback.m file: -(void)awakeFromNib {[[NSBundle mainBundle] loadNibNamed:@"FeedbackView" owner:self options:nil];[self addSubview: self.contentsView];}

*In a view controller i drag in a view, and set the custom class to the FeedbackView

*Finally I create an outlet from the controller to the FeedbackView, called feedBackView


Now I try to move feedbackView with the setFrame or setCenter methods, but my actual view in the .xib file is not moving with. However I can move the feedbackView.contentsView, but then the buttons stop working.
What I really would like to do is having the feedbackView in the view controller hugging on to the contents in the .xib file and just moving it, and the subview contentsView will move with.

A: I found out that the problem was that I had autolayout on. I turned it off and everything is now working smoothly. For the having the feedbackView hugging on to its contents I tried the [self.feedbackView sizeToFit]; which supposedly should fit the superview around its contents. However this is not working, if the FeedbackView.xib is 50 in height, and feedbackView is 100 calling the method will not change anything.
