UIKeyCommand.Create 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
Create(NSString, UIKeyModifierFlags, Selector) |
建立 UIKeyCommand 的 Factory 方法。 |
Create(NSString, UIKeyModifierFlags, Selector, NSString) |
具現化新 UIKeyCommand 的 Factory 方法。 |
Create(NSString, UIKeyModifierFlags, Selector)
建立 UIKeyCommand 的 Factory 方法。
[Foundation.Export("keyCommandWithInput:modifierFlags:action:")]
public static UIKit.UIKeyCommand Create (Foundation.NSString keyCommandInput, UIKit.UIKeyModifierFlags modifierFlags, ObjCRuntime.Selector action);
static member Create : Foundation.NSString * UIKit.UIKeyModifierFlags * ObjCRuntime.Selector -> UIKit.UIKeyCommand
參數
- keyCommandInput
- NSString
- modifierFlags
- UIKeyModifierFlags
- action
- Selector
傳回
- 屬性
備註
[Export("NewFileAccelerator:")]
void NewFileAccelerator(UIKeyCommand cmd)
{
//etc...
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
var actionSelector = new Selector("NewFileAccelerator:");
accelerator = UIKeyCommand.Create((NSString) "N",
UIKeyModifierFlags.Command, actionSelector);
AddKeyCommand(accelerator);
}
適用於
Create(NSString, UIKeyModifierFlags, Selector, NSString)
具現化新 UIKeyCommand 的 Factory 方法。
[Foundation.Export("keyCommandWithInput:modifierFlags:action:discoverabilityTitle:")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public static UIKit.UIKeyCommand Create (Foundation.NSString keyCommandInput, UIKit.UIKeyModifierFlags modifierFlags, ObjCRuntime.Selector action, Foundation.NSString discoverabilityTitle);
static member Create : Foundation.NSString * UIKit.UIKeyModifierFlags * ObjCRuntime.Selector * Foundation.NSString -> UIKit.UIKeyCommand
參數
- keyCommandInput
- NSString
- modifierFlags
- UIKeyModifierFlags
- action
- Selector
- discoverabilityTitle
- NSString
傳回
- 屬性