zoukankan      html  css  js  c++  java
  • iPad 开发陷井1 不及格的程序员

    在我开发通用版儿童教育类 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]; 图片视图的内容模视,必须为缩放模式,其它模式,显示会不正确。

    南来地,北往的,上班的,下岗的,走过路过不要错过!

    ======================个性签名=====================

    之前认为Apple 的iOS 设计的要比 Android 稳定,我错了吗?

    下载的许多客户端程序/游戏程序,经常会Crash,是程序写的不好(内存泄漏?刚启动也会吗?)还是iOS本身的不稳定!!!

    如果在Android手机中可以简单联接到ddms,就可以查看系统log,很容易看到程序为什么出错,在iPhone中如何得知呢?试试Organizer吧,分析一下Device logs,也许有用.

    我的开发工具

    对于博客园里的网友,不敢称为叫"程序员"的人,你们攻击性太强,看来你们是不会想到我的用意的.园子里有不少人都非常喜欢Jeffrey,是因为它的第一版 框架设计 CLR via C#.
    可是从第一版到现在的第三版,没有看到真正底层的东西,内容仅仅是比MSDN文档更丰富一些,可能是我的要求太高了吧.
    也就是因为它很多时候会接触到微软开发人员,会经常聊聊某些问题而已,而它又将这些问题反应到书中.也许它就像一个小记者.
    它的年龄大我们不多,我的孩子与它小儿子一般大,如果我能向它那样出入微软与它们开发人员长时间交流,不仅仅会牛成它这样.....
    可是微软的开发人员不会扔太多时间在它这儿的.所以它会整天追着这个,赶它那个..屁颠个不停吧...
    而它的另一版被称为好书的 Windows核心编程,更是没有什么深度可言,仅仅是将windows提供的api,以及内核功能再重申了一遍.
    这些书对晋及编程知识是有些贡献的,再说一遍我不是在匾低谁,说说想法而已.

  • 相关阅读:
    repr() Vs str()
    默认参数
    元组
    字典
    电脑可以办的两类最基本的事情
    代码块
    变量名
    print的逻辑
    input的逻辑
    让python2听懂中文
  • 原文地址:https://www.cnblogs.com/ioriwellings/p/2182551.html
Copyright © 2011-2022 走看看