AutoLayout 기능을 사용하고 있습니다. 모든 것이 제대로 작동하지만, 프로그램 적으로 컨트롤의 크기를 조정하면 다른 하위 뷰나 컨트롤이 적절하게 정렬되지 않습니다. 프로그래밍 방식으로 컨트롤의 크기를 조정 한 후 제약 조건을 어떻게 업데이트합니까?크기 조정 컨트롤을 프로그래밍 한 후에 AutoLayout이 작동하지 않습니다 - iOS
또는
코드의 크기를 조절 한 후 AutoLayout이 작동합니까?
편집 : 여기
내가 문자열을 기반으로, 텍스트 뷰의 크기를 조정하고 있지만, 아래 파단과 중복된다.
- (void)textViewDidChange:(UITextView *)textView
{
if (textView == pupose_txt_view) {
CGSize maximumLabelSize = CGSizeMake(self.topic_text_view.frame.size.width,
FLT_MAX);
UILabel *label = [[UILabel alloc] initWithFrame:pupose_txt_view.frame];
CGSize expectedLabelSize = [pupose_txt_view.text sizeWithFont:pupose_txt_view.font
constrainedToSize:maximumLabelSize
lineBreakMode:label.lineBreakMode];
CGRect newFrame = pupose_txt_view.frame;
newFrame.size.height = expectedLabelSize.height;
pupose_txt_view.frame = newFrame;
}
}
컨트롤의 크기를 조정하고 코드를 표시하는 방법은 무엇입니까? – Sven
@Sven 편집을 확인하십시오. – Newbee