Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/116.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 为什么UITableview单元格内容在滚动时缩放?_Ios_Swift_Uitableview - Fatal编程技术网

Ios 为什么UITableview单元格内容在滚动时缩放?

Ios 为什么UITableview单元格内容在滚动时缩放?,ios,swift,uitableview,Ios,Swift,Uitableview,我在我的项目中集成了一个tableview。我面临这样的问题:当我将tableview与我的UITableViewCell内容自动缩放一起滚动时。虽然我没有对UITableViewCell内容执行任何操作,但我只是对tableview上方的UIView设置了动画 下面是我的源代码片段 func scrollViewDidScroll(scrollView: UIScrollView) { let scrollViewHeight = Float(scrollView.frame.size.he

我在我的项目中集成了一个
tableview
。我面临这样的问题:当我将tableview与我的
UITableViewCell
内容自动缩放一起滚动时。虽然我没有对
UITableViewCell
内容执行任何操作,但我只是对tableview上方的
UIView
设置了动画

下面是我的源代码片段

func scrollViewDidScroll(scrollView: UIScrollView)
{

let scrollViewHeight = Float(scrollView.frame.size.height)
let scrollContentSizeHeight = Float(scrollView.contentSize.height)
let scrollOffset = Float(scrollView.contentOffset.y)

    print(scrollOffset)
            if (scrollOffset == 0)
            {
                self.horizontalSpacing.constant = 8

                UIView.animateWithDuration(0.5)
                {
                    self.view.layoutIfNeeded()
                }
            }
            else if (scrollOffset + scrollViewHeight <= scrollContentSizeHeight)
            {
                self.horizontalSpacing.constant = -75

                UIView.animateWithDuration(1.0)
                {
                    self.view.layoutIfNeeded()
                }
            }
      }
func scrollViewDidScroll(scrollView:UIScrollView)
{
让scrollViewHeight=浮动(scrollView.frame.size.height)
让scrollContentSizeHeight=浮动(scrollView.contentSize.height)
让scrollOffset=Float(scrollView.contentOffset.y)
打印(滚动偏移)
如果(scrollOffset==0)
{
self.horizontalSpacing.constant=8
UIView.animateWithDuration(0.5)
{
self.view.layoutifneed()
}
}
否则如果(scrollOffset+scrollViewHeightswift 2.2:在我的情况下:
检查func tableView(tableView:UITableView,heightForRowAtIndexPath:nsindepath)->CGFloat{}
将任何行self.view.frame.size.height更改为uisceen.main.bounds.height