在我开发通用版儿童教育类 iOS App<<单刀会>>中遇到了如下小陷井:
在iOS设备中播放视频,iPad与iPhone在界面与形为上有一点小差别....,iPad默认情况会在视频控制器右上角多出一个切换全屏的按钮。
同样的代码形成的效果见截图:
MPMoviePlayerController *theMovie = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Desc" ofType:@"mp4"] ]];
[self.view addSubview:theMovie.view];
theMovie.controlStyle = MPMovieControlStyleDefault; // 实际上在ios文件当说该枚举与MPMovieControlStyleFullscreen是一致的,可是实际效果却有一个小偏差
theMovie.scalingMode = MPMovieScalingModeAspectFill;
[theMovie setFullscreen:YES animated:YES];
如果用户点击切换全屏后,视频会消息但是它并没有停...,在iPhone不会有切换按钮.
在ipad的退出全屏通知中,程序员需要额外处理些问题,比如状态条的隐藏,停止播放等等.
iOS6废弃了
shouldAutorotateToInterfaceOrientation:
Returns a Boolean value indicating whether the view controller supports the specified orientation.
(Deprecated in iOS 6.0. Override the supportedInterfaceOrientations
andpreferredInterfaceOrientationForPresentation
methods instead.)
restorationIdentifier
The identifier that determines whether the view controller supports state restoration.
Discussion
This property indicates whether the view controller and its contents should be preserved and is used to identify the view controller during the restoration process. The value of this property is nil
by default, which indicates that the view controller should not be saved. Assigning a string object to the property lets the system know that the view controller should be saved. In addition, the contents of the string are your way to identify the purpose of the view controller.
During subsequent launches, UIKit asks your app for help in recreating the view controllers that were installed the last time your app ran. When it asks for a specific view controller, UIKit provides your app with this restoration identifier and the restoration identifiers of any parent view controllers in the view controller hierarchy. Your app must use this information to create or locate the appropriate view controller object.
Important: Simply setting the value of this property is not enough to ensure that the view controller is preserved and restored. All parent view controllers must also have a restoration identifier. For more information about the preservation and restoration process, see View Controller Programming Guide for iOS.
Availability
- Available in iOS 6.0 and later.
添加到视图控制器根视图中的子视图,比如按钮什么的,如果 边界超出了根视图的边界,那么它即使可见,也不可交互。。。
resizableImageWithCapInsets
[image stretchableImageWithLeftCapWidth:12.0f topCapHeight:18.0f]; 图片视图的内容模视,必须为缩放模式,其它模式,显示会不正确。
南来地,北往的,上班的,下岗的,走过路过不要错过!
======================个性签名=====================
之前认为Apple 的iOS 设计的要比 Android 稳定,我错了吗?
下载的许多客户端程序/游戏程序,经常会Crash,是程序写的不好(内存泄漏?刚启动也会吗?)还是iOS本身的不稳定!!!
如果在Android手机中可以简单联接到ddms,就可以查看系统log,很容易看到程序为什么出错,在iPhone中如何得知呢?试试Organizer吧,分析一下Device logs,也许有用.