我在我的UIScrollview
使用iPhone app
。我给自己定的UIScrollview
320 * 548
默认大小。我想增加UIScrollview
高度动态的使用编程,但我没有成功呢。我用下面的代码
CGRect scrollFrame;
scrollFrame.origin = _tblScroolView.frame.origin;
scrollFrame.size = CGSizeMake(320, 700);
_tblScroolView.frame = scrollFrame;
请帮我
谢谢!
要改变滚动视图的大小
scrollView.frame = CGRectMake(originX, originY, width, height);
改变滚动区域的大小:
scrollView.contentSize = CGSizeMake(width, height);
斯威夫特3版
scrollView.frame = CGRect(x: scrollX, y: scrollY, width:width, height:height)
scrollView.contentSize = CGSize(width:width, height: height)
触发任何功能,当你需要增加你的滚动视图然后在函数中使用此代码,让你想要的大小了滚动
scrollViewName.frame = CGRectMake(originX, originY, width, height);
改变滚动区域
scrollViewName.content.size = CGSizeMake(width, height);...
int height = 600;
for (i = 0; i<5; i++)
{
// do what you want. suppose you create a view which size is - 10,10,300,800.
height = createdView.frame.size.height+10;
}
scrollView.contentSize = (320, height);
希望这会帮助你。