【问题标题】:How to override a function of an Ios ObjC class?如何覆盖 Ios ObjC 类的函数?
【发布时间】:2018-12-21 23:11:12
【问题描述】:

我有这门课:

  UIViewController = interface(UIResponder)
    ['{F7A5E372-3F4A-4F25-A2F9-C91D7CB5FC09}']
    ....
    function supportedInterfaceOrientations: NSUInteger; cdecl;      
    ....  
  end;
  TUIViewController = class(TOCGenericImport<UIViewControllerClass, UIViewController>)  end;

而且我需要重写函数supportedInterfaceOrientations。在 xcode 下是这样的:

class NavigationController: UIViewController { 

    override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
        return .portrait
    }

}

delphi tokyo下怎么做?

【问题讨论】:

  • UIViewController 是一个接口,而不是一个类。
  • 对不起 Dsm,我的错误,我更新了问题...
  • 你不重写接口函数,你只是实现它们。

标签: delphi firemonkey


【解决方案1】:

在 firemonkey iOS 应用程序中,您不需要自己处理。

在应用程序 > 方向下的项目选项中,您可以启用自定义方向并定义所有四个方向(纵向、倒置、横向主页右、横向主页左),这允许您配置相同的行为。这与 UIInterfaceOrientationMask 提供的接口相同。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-10
    • 1970-01-01
    • 2018-12-23
    • 2011-01-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多