Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 是一个UIScrollView’;s相对于contentInset的contentOffset_Ios_Uiscrollview - Fatal编程技术网

Ios 是一个UIScrollView’;s相对于contentInset的contentOffset

Ios 是一个UIScrollView’;s相对于contentInset的contentOffset,ios,uiscrollview,Ios,Uiscrollview,假设我将UIScrollview的contentInset.top设置为100,然后将contentOffset.y设置为0 如果我在滚动视图中放置了一个具有frame.y=0的元素,我希望该元素位于滚动视图的顶部,或者100px向下?根据您的设置,它将向下100磅,因为frame.y=0是相对于 中的第一个俯视图 topView.y = contentInset.top + contentOffset.y

假设我将UIScrollview的
contentInset.top
设置为
100
,然后将
contentOffset.y
设置为
0


如果我在滚动视图中放置了一个具有
frame.y=0
的元素,我希望该元素位于滚动视图的顶部,或者100px向下?

根据您的设置,它将向下100磅,因为frame.y=0是相对于

中的第一个俯视图

topView.y = contentInset.top + contentOffset.y