解决方案 »

  1.   

    有一个 line什么的属性  设置下试试看  
      

  2.   

    加一个断行属性就行了:nameLabel1.lineBreakMode = NSLineBreakByCharWrapping;
      

  3.   

    nameLabel1.lineBreakMode = NSLineBreakByCharWrapping;
    和nameLabel1.lineBreakMode = NSLineBreakByWordWrapping;
    这个我试过了,没用啊
      

  4.   

    你这个是运行在ios7上面吗?我用的xcode5,IOS7,确实是没用的
      

  5.   

    你这个是运行在ios7上面吗?我用的xcode5,IOS7,确实是没用的
    果然,我用的是iOS8,iOS6和iOS8都正常,iOS7.1估计是Bug了
      

  6.   

    你用 .attributedText 试试,使用NSAttributedString来构造排布属性为NSLineBreakByCharWrapping的,应该可以解决。
    UIFont* font = [UIFont systemFontOfSize:14.f];
    NSMutableParagraphStyle* style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
    style.alignment = self.userSelectedTextAlignment;
    style.lineBreakMode = NSLineBreakByCharWrapping;
    NSMutableDictionary* textAttributes = [NSMutableDictionary dictionaryWithObjectsAndKeys:font, NSFontAttributeName
                                         , style, NSParagraphStyleAttributeName
                                         , [UIColor blackColor], NSForegroundColorAttributeName, nil];
      

  7.   

    写漏了...补充下...nameLabel1.attributedText = [[NSAttributedString alloc] initWithString:@"丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁wwwwwwwwwwwwwwww丁" attributes:textAttributes];
      

  8.   

    我之前试过,在iOS7下无效的确实是没有用的,ios7下怎么解决呢?
      

  9.   

    我是楼主,贴下解决方案,重写UILabel,问题解决