Sportica   Sportica

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; 

 

posted @ 2012-12-04 17:30  qingjoin  阅读(14139)  评论(2编辑  收藏  举报
  Sportica