2013-09-27 19 views
12

Viene visualizzato un errore che dice che UILineBreakModeTailTruncation è obsoleto, qualche suggerimento?UILineBreakModeTailTruncation è obsoleto

[[self.userButton titleLabel] setLineBreakMode:UILineBreakModeTailTruncation]; 
+4

Guardate la documentazione per 'UILineBreakModeTailTruncation'. Ti dice invece cosa usare. – rmaddy

risposta

34

devi usare NSLineBreakByTruncatingTail

0

Swift 3 Versione:

lineBreakMode = .byTruncatingTail

-1
typedef NS_ENUM(NSInteger, NSLineBreakMode) {  /* What to do with long lines */ 
    NSLineBreakByWordWrapping = 0,   /* Wrap at word boundaries, default */ 
    NSLineBreakByCharWrapping,  /* Wrap at character boundaries */ 
    NSLineBreakByClipping,  /* Simply clip */ 
    NSLineBreakByTruncatingHead, /* Truncate at head of line: "…wxyz" */ 
    NSLineBreakByTruncatingTail, /* Truncate at tail of line: "abcd…" */ 
    NSLineBreakByTruncatingMiddle /* Truncate middle of line: "ab…yz" */ 
} NS_ENUM_AVAILABLE_IOS(6_0); 

// we use now! 
+1

per favore aggiungi qualche descrizione per supportare il tuo codice! –

Problemi correlati