XSLT存档  

不及格的程序员-八神

 查看分类:  ASP.NET XML/XSLT JavaScripT   我的MSN空间Blog
posts - 174,  comments - 1172,  trackbacks - 0

在我开发通用版儿童教育类 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.)

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
 
如果想最低支持ios5,那么***-Info.plist文件中的Supported interface orientations (iPad) 也必须相应设置,否则代码中设置仅支持竖立方向,但plist全支持,代码也是无效的。

 


 

restorationIdentifier

The identifier that determines whether the view controller supports state restoration.

@property(nonatomic, copy) NSString *restorationIdentifier
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]; 图片视图的内容模视,必须为缩放模式,其它模式,显示会不正确。

posted on 2011-09-20 15:46 不及格的程序员-八神 阅读(...) 评论(...) 编辑 收藏