Chinaunix首页 | 论坛 | 博客
  • 博客访问: 397166
  • 博文数量: 466
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 10
  • 用 户 组: 普通用户
  • 注册时间: 2015-03-16 13:59
文章分类

全部博文(466)

文章存档

2015年(466)

我的朋友

分类: C/C++

2015-03-16 14:23:22

if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad )

{

// The device is an iPad running iPhone 3.2 or later.

}

else

{

NSArray *modes = [UIScreen mainScreen].availableModes;

UIScreenMode *mode = [modes objectAtIndex:0];

if( mode.size.width == 640 )

{

// The device is an iPhone 4

[director setContentScaleFactor:2];

}

else

{

// The device is an old school iPhone or iPod touch.

}

}




//-----------------------------------------------------------

#define isRetina ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)

gDisplayRatio = 1.0;

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){

gCurrentDisplayMode = DISP_IPAD;

gDisplayRatio = 2.0;

}

else

{

if (isRetina == YES) {

[director setContentScaleFactor:2.0];

gCurrentDisplayMode = DISP_RETINA;

}else {

gCurrentDisplayMode = DISP_WXVGA;


}

}



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