UILineBreakModeWordWrap está en desuso
Aquí está mi código:
CGSize s = [string sizeWithFont:[UIFont systemFontOfSize:20]
constrainedToSize:CGSizeMake(self.view.bounds.size.width - 40, CGFLOAT_MAX) // - 40 For cell padding
lineBreakMode:UILineBreakModeWordWrap];
Recibo una advertencia de que UILinebBreakModeWordWrap está obsoleto en iOS 6.
82
2 answers
Necesitas usar NSLineBreakByWordWrapping
en iOS 6
Para su código intente esto:
NSString *string = @"bla";
CGSize s = [string sizeWithFont:[UIFont systemFontOfSize:20]
constrainedToSize:CGSizeMake(self.view.bounds.size.width - 40, CGFLOAT_MAX) // - 40 For cell padding
lineBreakMode:NSLineBreakByWordWrapping];
Un ejemplo en una etiqueta sería:
[label setLineBreakMode:NSLineBreakByWordWrapping];
En lugar de
label.lineBreakMode = UILineBreakModeWordWrap;
202
Author: Andy,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-03-30 23:02:38
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-03-30 23:02:38
Para mantener la compatibilidad con versiones anteriores, puede crear una macro como se muestra a continuación:
#ifdef __IPHONE_6_0
# define LINE_BREAK_WORD_WRAP NSLineBreakByWordWrapping
#else
# define LINE_BREAK_WORD_WRAP UILineBreakModeWordWrap
#endif
14
Author: Mihriban Minaz,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-07-17 20:16:19
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-07-17 20:16:19