【发布时间】:2013-06-11 07:29:16
【问题描述】:
我在滚动视图中有一个文本视图,我想让文本视图的高度作为其内容是动态的,因为我不想单独滚动文本视图,实际上我想滚动文本视图与滚动视图一起。
事实上,我对上图右侧的菜单感到困惑,关于约束高度等于、小于、大于、...
我不想让高度稳定,我希望它是动态的,在我的代码中:
CGRect frame = self.detailTextView.frame;
frame.size.height = self.detailTextView.contentSize.height;
self.detailTextView.frame = frame;
scroll.contentSize = CGSizeMake(scroll.contentSize.width,
200 + self.detailTextView.frame.size.height);
[self.detailTextView setFrame:frame];
其中detailTextView是文本视图的名称,scroll是滚动视图的名称。
但它不能正常工作,我该怎么办请帮忙!
注意:这个问题和(使用自动布局)的复选框有什么关系,因为它在我的应用程序中被选中
【问题讨论】:
-
没有人来回答我?
标签: iphone ios xcode uiscrollview uitextview