HTML5   发布时间:2022-04-27  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了objective-c – 当我设置锚点时,我的图像没有加载大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个UIView,我正在加载我的图像视图作为子视图.当我没有设置锚点时图像显示,但每当我设置锚点时图像都没有显示.我还添加了QUARTZCore框架工作.

我在下面添加我的代码

CGRect apprect=CGRectMake(0,1024,768);
UIView *containerView = [[UIView alloc] initWithFrame:apprect1];
containerView.BACkgroundColor = [UIColor whiteColor];
[self.view addSubview:containerView];

handleView1= [[UIImageView alloc] initWithImage:[UIImage imagenamed:@"large.gif"]];
[handleView1 setAlpha:1];
//[handleView1 setFrame:CGRectMake(390,172.00,56.00,316.00)];
handleView1.userInteractionEnabled = YES;
handleView1.layer.anchorPoint=CGPointMake(490.0,172.0);
[containerView addSubview:handleView1];

解决方法

问题是您用于anchorPoint的值.您不要将帧的位置设置为值.让我引用Apple:

有关详细信息,请查看Layer Geometry and Transforms in the Core Animation Programming Guide.

大佬总结

以上是大佬教程为你收集整理的objective-c – 当我设置锚点时,我的图像没有加载全部内容,希望文章能够帮你解决objective-c – 当我设置锚点时,我的图像没有加载所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。