Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5406370
  • 博文数量: 763
  • 博客积分: 12108
  • 博客等级: 上将
  • 技术积分: 15717
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-28 21:21
个人简介

业精于勤,荒于嬉

文章分类

全部博文(763)

文章存档

2018年(6)

2017年(15)

2016年(2)

2015年(31)

2014年(14)

2013年(87)

2012年(75)

2011年(94)

2010年(190)

2009年(38)

2008年(183)

2007年(28)

分类: C/C++

2011-08-25 09:41:45

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;


}

}



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