KYMagicMove icon indicating copy to clipboard operation
KYMagicMove copied to clipboard

您好,我看了你的博客,参考着敲了一遍,但是进入第二个控制器的时候图片位置有点偏移,不明白怎么调整,特意请教您下

Open lixiya1990 opened this issue 10 years ago • 3 comments

lixiya1990 avatar Aug 04 '15 05:08 lixiya1990

// 使用了autolayout 这时获取的frame 有可能不正确。
// 根据autolayout中使用了水品居中对齐,重新设置frame的original的xy值
snapShotView.frame=CGRectMake( 
(containerView.frame.size.width-snapShotView.frame.size.width)/2, 
snapShotView.frame.origin.y, 
snapShotView.frame.size.width, 
snapShotView.frame.size.height);

lulee007 avatar Oct 15 '15 05:10 lulee007

@lulee007 如果使用 AutoLayout ,调用 frame 之前先 layoutIfNeeded.

KittenYang avatar Oct 15 '15 14:10 KittenYang

@KittenYang 测试过了确实可以。谢谢指点

lulee007 avatar Oct 19 '15 06:10 lulee007