UIlabel 遇到\n 换行-iOS

NSString  *msg;
        msg = [NSString stringWithFormat:@"%@",[[[DATA.specificSearchList objectAtIndex:indexPath.row]objectForKey:@"content"] stringByReplacingOccurrencesOfString:@"\\n" withString:@" \r\n" ]];

label.numberOfLines = 0;        //不要忘记设置这个
label.text = msg; 

 

转载于:https://www.cnblogs.com/qingjoin/archive/2012/12/04/2801705.html

你可能感兴趣的:(UIlabel 遇到\n 换行-iOS)