iOS模拟器分辨率的问题(转载)
转载地址:http://justsee.iteye.com/blog/2123545
AppIcon
Asset
iPhone 6 Plus (@3x)
iPhone 6 and iPhone 5 (@2x)
iPhone 4s (@2x)
iPad and iPad mini (@2x)
iPad 2 and iPad mini (@1x)
App icon (required for all apps) |
180 x 180 |
120 x 120 |
120 x 120 |
152 x 152 |
76 x 76 |
App icon for the App Store (required for all apps) |
1024 x 1024 |
1024 x 1024 |
1024 x 1024 |
1024 x 1024 |
1024 x 1024 |
Launch file or image (required for all apps) |
Use a launch file (seeLaunch Images) |
For iPhone 6, use a launch file (see Launch Images) For iPhone 5, 640 x 1136 |
640 x 960 |
1536 x 2048 (portrait) 2048 x 1536 (landscape) |
768 x 1024 (portrait) 1024 x 768 (landscape) |
Spotlight search results icon (recommended) |
120 x 120 |
80 x 80 |
80 x 80 |
80 x 80 |
40 x 40 |
Settings icon (recommended) |
87 x 87 |
58 x 58 |
58 x 58 |
58 x 58 |
29 x 29 |
Toolbar and navigation bar icon (optional) |
About 66 x 66 |
About 44 x 44 |
About 44 x 44 |
About 44 x 44 |
About 22 x 22 |
Tab bar icon (optional) |
About 75 x 75 (maximum: 144 x 96) |
About 50 x 50 (maximum: 96 x 64) |
About 50 x 50 (maximum: 96 x 64) |
About 50 x 50 (maximum: 96 x 64) |
About 25 x 25 (maximum: 48 x 32) |
Default Newsstand cover icon for the App Store (required for Newsstand apps) |
At least 1024 pixels on the longest edge |
At least 1024 pixels on the longest edge |
At least 1024 pixels on the longest edge |
At least 1024 pixels on the longest edge |
At least 512 pixels on the longest edge |
Web clip icon (recommended for web apps and websites) |
180 x 180 |
120 x 120 |
120 x 120 |
152 x 152 |
76 x 76 |
iphone6/6+ 更新:
Icon-Small@3x.png 87*87
Icon-40@3x.png 120*120
Icon-60@3x.png 180*180
Icon.png 57*57
Icon@2x.png 114*114
Icon-Small.png 29*29
Icon-Small@2x.png 58*58
Icon-Small-50.png 50*50
Icon-Small-50@2x.png 100*100
Icon-72.png 72*72
Icon-72@2x.png 144*144
Icon-40.png 40*40
Icon-40@2x.png 80*80
Icon-60.png 60*60
Icon-60@2x.png 120*120
Icon-76.png 76*76
Icon-76@2x.png 152*152
LaunchImage
For iPhone 6
750 x 1334 (@2x) for portrait
1334 x 750 (@2x) for landscape
For iPhone 6 Plus:
1242 x 2208 (@3x) for portrait
2208 x 1242 (@3x) for landscape
---------------------------------------------------------------------
4.0 inch screen:
Default-568h@2x.png (old 640x1136 ~ for iPhone 5)
4.0 inch screen:
LaunchImage-700-568h@2x.png (new 640x1136 ~ for iPhone 5)
4.7 inch screen:
LaunchImage-800-667h@2x.png (750x1334 ~ for iPhone 6)
5.5 inch screen:
LaunchImage-800-Portrait-736h@3x.png (1242x2208 ~ for iPhone 6 Plus Portrait)
5.5 inch screen:
LaunchImage-800-Landscape-736h@3x.png (2208x1242 ~ for iPhone 6 Plus Landscape)
Retina iPad:
Default-Portrait@2x~ipad.png (1536x2048 ~ for Retina iPad Portrait)
Retina iPad:
Default-Landscape@2x~ipad.png (2048x1536 ~ for Retina iPad Landscape)
iPad Mini/iPad:
Default-Portrait~ipad.png (768x1024 ~ for iPad Portrait)
iPad Mini/iPad:
Default-Landscape~ipad.png (1024x768 ~ for iPad Landscape)
适配iphone6/6+启动界面
如果旧的工程直接跑到这两个模拟器中时,默认是"兼容模式",即系统会简单的把内容等比例放大,显示效果有些模糊但尚可接受。此时App内部获取到的设备分辨率和iPhone5是一样的:320*568 point。
启用高分辨率模式有2个方法:
1.添加大屏的LaunchImage:
在Images.xcassets里,删除旧的LaunchImage组,然后新建LaunchImage组,添加对应高分辨率的图片。(参考:http://matthewpalmer.net/blog/2014/09/10/iphone-6-plus-launch-image-adaptive-mode/)
2.添加Launch Screen File
Launch Screen是Xcode6和iOS8新加的功能,它用一个xib文件来作为启动画面。App在旧版iOS(低于ios8)启动时,该属性会被自动忽略,不会造成异常。
首先,点击New File ->iOS User Interface ->Launch Screen,然后在工程设置项里启用它:
LaunchFile
不过这个xib不能关联任何的代码(不能自定义View的Class,不能IBOutlet,不能加Object),可以理解成这个xib就是一张截图,这个方案的好处在于可以使用到Size Classes来针对不同屏幕布局这个xib。
上面两处设置,只要启用任意一个即可让App进入高分辨率模式;但如果两处都没有设置,则App会回退到兼容模式。
两处都设定的话在ios8会走Launch Screen File,在低于ios8 走LaunchImage
PS:iPhone4、iPhone5、iPhone6这几个设备的ppi都是相同的,默认图片优先是@2x。iPhone6 Plus的像素密度更高,默认图片优先是@3x。 另外,iPhone6 Plus有一点和其他设备不同:在App内部获得的屏幕分辨率是1242*2208,但设备实际分辨率是1920*1080,这时系统会把整体的显示内容做一个缩放,downscale到1/1.15。
UIPageControl的autoresizingMask
在设置UIPageControl实例的宽度时,显示的好像总是设置的四倍左右,但是把其他组建(UILable等)设置在同一父容器中显示的是正常的。头文件看到UIPageControl的autoresizingMask默认值是UIViewAutoresizingNone,但是感觉没起作用,于是这是下
- _mainPageControl.autoresizingMask = UIViewAutoresizingNone;
UIPageControl显示正确了。(apple的bug?)
UIActivityViewController crashing on iPads by sdk8
其老早在 https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIActivityViewController_Class/ 中就说了:On iPad, you must present the view controller in a popover. On iPhone and iPod touch, you must present it modally。
在sdk8之前你ipad还是用了presentViewController,那在dismissViewControllerAnimated的时候屏幕会旋转下,可能你还能接受,但是在sdk8便会直接crash,报错:
- 2014-10-15 14:03:25.927 BT2014[5133:488272] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'UIPopoverPresentationController (<_UIAlertControllerActionSheetRegularPresentationController: 0x145578890>) should have a non-nil sourceView or barButtonItem set before the presentation occurs.'
- *** First throw call stack:
- (0x187d9e084 0x1986900e4 0x18cc56bf0 0x18c81e3f8 0x18c81cf30 0x18c5a2efc 0x18c5149c0 0x187d56388 0x187d53314 0x187d536f4 0x187c81664 0x190d7f5a4 0x18c5864f8 0x1000c574c 0x198cfea08)
- libc++abi.dylib: terminating with uncaught exception of type NSException
所以用sdk8编译时ipad用pop,并且用新类:UIPopoverPresentationController
UIActivityViewController
- Accessing the Completion Handler
- completionHandler
- (iOS 8.0)
- The completion handler to execute after the activity view controller is dismissed.
- Declaration
- OBJECTIVE-C
- @property(nonatomic, copy) UIActivityViewControllerCompletionHandler completionHandler
- Discussion
- When the user-selected service finishes operating on the data, or when the user dismisses the view controller, the view controller executes this completion handler to let your app know the final result of the operation.
- Import Statement
- Availability
- Available in iOS 6.0 and later.
- Deprecated in iOS 8.0.
"LaunchServices: invalidationHandler called" with UIActivityViewController iOS8
In iOS8 when I present or dismiss a UIActivityViewController, my app logs: "LaunchServices: invalidationHandler called"。
参考:https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIPopoverPresentationController_class/index.html
https://devforums.apple.com/message/1049415#1049415
http://stackoverflow.com/questions/25192313/sharing-via-uiactivityviewcontroller-to-twitter-facebook-etc-causing-crash
可能是苹果的issue
ios sdk8/ios8 remoteNotification
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
在苹果UIApplication文件中说明:
@interface UIApplication (UIRemoteNotifications)
.
.
.
- (void)registerForRemoteNotificationTypes:(UIRemoteNotificationType)types NS_DEPRECATED_IOS(3_0, 8_0, "Please use registerForRemoteNotifications and registerUserNotificationSettings: instead");
// Returns the enabled types, also taking into account any systemwide settings; doesn't relate to connectivity.
- (UIRemoteNotificationType)enabledRemoteNotificationTypes NS_DEPRECATED_IOS(3_0, 8_0, "Please use -[UIApplication isRegisteredForRemoteNotifications], or -[UIApplication currentUserNotificationSettings] to retrieve user-enabled remote notification and user notification settings");
@end
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
所以在ios8中应该用的新的注册通知的代码:
- // IOS8 新的注册api
- if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
- {
- [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings
- settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge)
- categories:nil]];
- [[UIApplication sharedApplication] registerForRemoteNotifications];
- }
- else
- {
- //原来注册通知的代码
- [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
- (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
- }
原本在IOS7当中 判断push是否打开的方法是:
- UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
- return (types & UIRemoteNotificationTypeAlert);
如果将这段代码使用在 IOS8当中,虽然不会出现crash的现象,但永远返回空。 在IOS8中,我们使用如下的新代码来取代以上的代码:
- +(BOOL)enabledRemoteNotification{
- UIRemoteNotificationType types;
- if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
- {
- types = [[UIApplication sharedApplication] currentUserNotificationSettings].types;
- }
- else
- {
- types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
- }
- return (types & UIRemoteNotificationTypeAlert);
- }
ios 8 - buttons in horizontal scroll view intercepting pan event - scroll does not work
含有uibutton的ScrollView在iOS8中无法滚动的解决办法:
- theScrollView.panGestureRecognizer.delaysTouchesBegan = theScrollView.delaysContentTouches
IBInspectable / IBDesignable
http://justsee.iteye.com/admin/blogs/2236938
UIScreen(view.frame)
http://justsee.iteye.com/blog/2154757
iOS8 notification


评论
发表评论

- 浏览: 1407278 次
- 性别:
- 来自: China
文章分类
- 全部博客 (495)
- ajax (1)
- Algorithm (14)
- Android (41)
- CSS/HTML... (2)
- defy (3)
- DesignPattern (2)
- dorado (0)
- Drools (6)
- English/日本語 (7)
- Flex (2)
- Framework (0)
- Google (3)
- hibernate (13)
- homework (3)
- HTML5 (0)
- IDE (26)
- java (45)
- javaee (7)
- Javascript (12)
- java组件 (5)
- jQuery (4)
- jsp (8)
- jsf (2)
- Linux (2)
- lucene (0)
- mysql (6)
- news (3)
- Oracle (8)
- other (4)
- PHP (5)
- Python (0)
- Software Engineering (3)
- spring (7)
- struts1.x (14)
- struts2.x (14)
- strolling in cloud (1)
- subject:javaEnhance (20)
- Tomcat (7)
- validator (3)
- 学习·方法·心得 (8)
- .NET (2)
- vba (6)
- groovy (5)
- grails (2)
- SWT (0)
- big data (1)
- perl (1)
- objective-c (50)
- product (1)
- mac (7)
- ios (160)
- ios-phone (2)
- ios-system (15)
- ios-network (3)
- ios-file (4)
- ios-db (1)
- ios-media (1)
- ios-ui (25)
- ios-openSource (5)
- ios-animation (2)
- ios-drawing (7)
- c (2)
- ios-app (2)
- ios-course (15)
- ios-runtime (13)
- ios-code (8)
- ios-thread (7)
- ios-LBS (2)
- ios-issue (1)
- ios-design (2)
- Jailbreak (2)
- cocos2d (0)
- swift (8)
- ios-framework (3)
- apple watch (4)
评论排行榜
最新评论
- llei234: 看了之后受益匪浅,感谢大神的分享
java中ThreadLocal类的使用 - 啸笑天: 三种方法来获取SEL:sel_registerName函数Ob ...
Objective-C Runtime - 啸笑天: http://southpeak.github.io/blog ...
Objective-C Runtime - 啸笑天: http://code.tutsplus.com/tutori ...
WatchConnectivity - 啸笑天: http://www.onevcat.com/2015/08/ ...
Complications on the watch face
声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。若作者同意转载,必须以超链接形式标明文章原始出处和作者。
© 2003-2015 ITeye.com. All rights reserved. [ 京ICP证110151号 京公网安备110105010620 ]
iOS模拟器分辨率的问题(转载)的更多相关文章
- Appium+python自动化17-启动iOS模拟器APP源码案例【转载】
前言 上一篇已经可以启动iOS模拟器上的safari浏览器了,启动app比启动浏览器要复杂一点,本篇以github上的源码为案例详细介绍如何启动iOS模拟器的app 一.clone源码 1.githu ...
- IOS开发之——IOS模拟器调试蓝牙BLE
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/zhenyu5211314/article/details/24399887 因为在iPhone 4s ...
- Mac下搭建Appnium+Python+Ios模拟器环境
转载:https://www.jianshu.com/p/f7cf077d9444 https://blog.csdn.net/a158123/article/details/79684499 htt ...
- Xamarin的不归路-ios模拟器调整窗口大小
ios模拟器调整窗口大小:
- Xamarin的不归路-ios模拟器没有键盘
ios模拟器没有键盘解决方案: 勾选上就有了. 2016年9月1日
- Xcode无法启动ios模拟器的问题
一.问题描述 开发过程需要来回切换ios模拟器调试程序,开始在iPhone 4s下调试,然后切换到iPhone 6s Plus,再切换回iPhone 4s,遇到无法启动ios模拟器.错误提示如下: 二 ...
- storyboard在ios模拟器无法显示的问题
一.问题描述 1.在原有项目新建一个名称为test的storyboard类型的文件. 2.test.storyboard添加View Controller,并设置View Controller下Vie ...
- Xcode5 运行程序 提示IOS 模拟器未能安装此应用程序
更新了Xcode5,结果模拟器各种不配合,首先遇到的问题就是提示“IOS 模拟器未能安装此应用程序” 上网查了一下,网友给出的解决办法“删除~/Library/Application Support/ ...
- Xamarin.iOS模拟器调试找不到资源文件
Xamarin.iOS模拟器调试找不到资源文件 在Visual Studio 2015中,运行Xamarin.iOS项目,出现找不到资源文件的错误.错误信息:System.IO.FileNotFoun ...
随机推荐
- thinkphp学习资料
http://www.5idev.com/p-thinkphp_auto_function_callback.shtml
- ibatis中的resultClass,parameterClass,resultMap,resultType的使用与区别
parameterClass 是参数类.指定了参数的完整类名(包括包路径).可通过别名避免每次重复书写冗长的类名. resultClass 是结果类, 二.resultClass取值 1.result ...
- 在MVC中如何愉快使用Ajax
前言: 这个故事要从我老大与客户谈需求开始说起.前几天,遇见一个逗比客户,不知道是听了哪个逗比程序员的临终遗言...让我们给他做一个手机端的Web应用出来,还说要使用MVC来做(不是App).马币,客 ...
- Github提交代码及分支管理
#提交代码cd <Cat>git initgit add .git statusgit commit -m "注释"git remote add origin < ...
- Java系列--第七篇 基于Maven的Android开发实战项目
本篇是基于<Android应用案例开发大全,吴亚峰等著>的项目开发实例源码,其中有些图片,我做了一些修改,用于个人学习,请勿用于商业. 1, 日程管理专家 mvn archetype:ge ...
- POJ1840 hash
POJ1840 问题重述: 给定系数a1,a2, ..,a5,求满足a1 * x1 ^ 3 + a2 * x2 ^ 3 +... + a5 * x5 ^ 3 = 0的 xi 的组数.其中ai, xi都 ...
- 原生app,WEBAPP,混合app
什么叫做原生App? 原生App是专门针对某一类移动设备而生的,它们都是被直接安装到设备里,而用户一般也是通过网络商店或者卖场来获取例如 The App Store 与 Android Ap ...
- Android再学习-20141111-Android应用的七大件
Android应用的七大件 应用程序的四大组件: Android的四大组件,使用时需要在程序中注册. Activity: Activity是应用程序的一个界面,可以通过这个界面查看联系人.打电话或者玩 ...
- Pyzo -- 好用的 Python 轻量级 IDE
近期 yvivid 使用 Python 进行科学计算类应用(如matlab部分应用场景) 比较好的 发行版本为 Anaconda: A free distribution for the SciPy ...
- DUIEngine使用Visual Studio 2010编译Debug_Dll版有关Error MSB3073错误解决方案
在使用Visual Studio 2010编译DUIEngine的Debug_Dll版如果遇见如下错误: 错误 64 error MSB3073: 命令“copy D:\SomePath\DUIEng ...