2015-09-28 5 views

Antwort

11

Ja, es ist möglich, UIApplicationShortcutIcon. Laut docs:

Es gibt drei Arten von Schnellaktionssymbol:

  1. Ein Symbol aus einem System bereitgestellte Bibliothek von gängigen Typen, wie

  2. Eines in der UIApplicationShortcutIconType Aufzählung beschrieben Symbol abgeleitet aus einem benutzerdefinierten Vorlagenbild im Paket Ihrer App und vorzugsweise in einem Bestandskatalog

  3. Ein Symbol, das einen Kontakt im Benutzer darstellt ‚S Adressbuch, mit dem Sie den ContactsUI Rahmen Zugriff durch (siehe ContactsUI Rahmen Referenz)

Sie iconWithTemplateImageName: neue Schaltfläche intialiaze verwenden können. ZB:

- (void)createDynamicShortcutItems { 

    // create several (dynamic) shortcut items 
    UIApplicationShortcutItem *item1 = [[UIApplicationShortcutItem alloc]initWithType:@"Item 1" localizedTitle:@"Item 1"]; 
    UIApplicationShortcutItem *item2 = [[UIApplicationShortcutItem alloc]initWithType:@"Item 2" localizedTitle:@"Item 2"]; 
    UIApplicationShortcutItem *item3 = [[UIApplicationShortcutItem alloc]initWithType:@"Item 3" localizedTitle:@"Item 3"]; 

    // add all items to an array 
    NSArray *items = @[item1, item2, item3]; 

    // add the array to our app 
    [UIApplication sharedApplication].shortcutItems = items; 
} 

Siehe Apple Docs.