美文网首页iOS基础
iOS屏幕旋转导致UITableViewCell Content

iOS屏幕旋转导致UITableViewCell Content

作者: LPrison | 来源:发表于2021-06-30 14:43 被阅读0次

问题描述

在旋屏幕的时候,tableVIewCell布局没有生效,出现ContentView位置错乱

修复方法

    // iOS 13 之后横竖屏切换的时候 self.contentView 会变化
    if (self.contentView.frame.origin.x > 0 ) {
            self.contentView.frame = CGRect(x: 0, y: self.contentView.frame.origin.y, width: self.contentView.frame.size.height, height: self.contentView.frame.size.height);
        }

相关文章

网友评论

    本文标题:iOS屏幕旋转导致UITableViewCell Content

    本文链接:https://www.haomeiwen.com/subject/uujrultx.html