Chinaunix首页 | 论坛 | 博客
  • 博客访问: 705383
  • 博文数量: 260
  • 博客积分: 7033
  • 博客等级: 少将
  • 技术积分: 2633
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-13 23:15
文章分类

全部博文(260)

文章存档

2012年(2)

2011年(41)

2010年(78)

2009年(139)

我的朋友

分类:

2009-10-22 15:40:36


1. 在UIView中,将该view使用到的坐标进行旋转,这样当该view addSubview时,会使用坐标方向来进行:


@implementation PoseDetailContentView

- (id)initWithFrame:(CGRect)frame 

{

    if (self = [super initWithFrame:frame]) 

{

            // Important here, rotate THIS UIView

            [self setCenter: CGPointMake(160.0f, 240.0f)];

            [self setTransform: CGAffineTransformMakeRotation(degreesToRadian(90))];


2. 

该view中的其他子视图使用原计划的坐标,添加到横屏中即可.


补充:

下面的代码,可以让UIView即旋转,又缩放.


        CGAffineTransform transform = CGAffineTransformMakeRotation(degreesToRadian(60));

        transform = CGAffineTransformScale(transform, 0.5, 0.5);

        

        [self setTransform: transform];    // this effects the SUBVIEWS rotate and scale



阅读(849) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~