相关疑难解决方法(0)

更改我的CALayer的anchorPoint会移动视图

我想改变anchorPoint,但保持视图在同一个地方.我试过NSLog-ing分词self.layer.positionself.center他们都保持不变,无论更改anchorPoint的.然而我的观点却在变化

关于如何做到这一点的任何提示?

self.layer.anchorPoint = CGPointMake(0.5, 0.5);
NSLog(@"center point: %f %f", self.layer.position.x, self.layer.position.y);
self.layer.anchorPoint = CGPointMake(1, 1);
NSLog(@"center point: %f %f", self.layer.position.x, self.layer.position.y);
Run Code Online (Sandbox Code Playgroud)

输出是:

2009-12-27 20:43:24.161 Type[11289:207] center point: 272.500000 242.500000
2009-12-27 20:43:24.162 Type[11289:207] center point: 272.500000 242.500000
Run Code Online (Sandbox Code Playgroud)

iphone cocoa cocoa-touch uiview

127
推荐指数
7
解决办法
7万
查看次数

从底部到顶部移动UIView

如何在代码上从下到上移动视图:

colorView.hidden=NO;
colorView=[[UIView alloc]init];
colorView.frame=CGRectMake(0,480,320, 480);
colorView.bounds=CGRectMake(0,200,320, 280);
colorView.backgroundColor=[UIColor greenColor];
colorView.alpha=1.0f;
[webView addSubview:colorView];
[self.view addSubview:webView];
[self createTransparentView];
Run Code Online (Sandbox Code Playgroud)

那我怎么能在这里添加动画呢?

xcode animation uiview ios uistoryboard

6
推荐指数
1
解决办法
5万
查看次数

标签 统计

uiview ×2

animation ×1

cocoa ×1

cocoa-touch ×1

ios ×1

iphone ×1

uistoryboard ×1

xcode ×1