UILabel中有英文和中文的情况 uilabel 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 有一个 line什么的属性 设置下试试看 加一个断行属性就行了:nameLabel1.lineBreakMode = NSLineBreakByCharWrapping; nameLabel1.lineBreakMode = NSLineBreakByCharWrapping;和nameLabel1.lineBreakMode = NSLineBreakByWordWrapping;这个我试过了,没用啊 你这个是运行在ios7上面吗?我用的xcode5,IOS7,确实是没用的 你这个是运行在ios7上面吗?我用的xcode5,IOS7,确实是没用的果然,我用的是iOS8,iOS6和iOS8都正常,iOS7.1估计是Bug了 你用 .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]; 写漏了...补充下...nameLabel1.attributedText = [[NSAttributedString alloc] initWithString:@"丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁丁wwwwwwwwwwwwwwww丁" attributes:textAttributes]; 我之前试过,在iOS7下无效的确实是没有用的,ios7下怎么解决呢? 我是楼主,贴下解决方案,重写UILabel,问题解决 UIScrollView上面创建了许多按钮之后滚动不流畅的问题 【为什么UIView里的Label看不到?? 关于XCODE4如何创建控制器 iphone能否在程序中获得自己当前位置下的经纬度 iphone openGLES加载纹理问题 开发ios应用必须用苹果的电脑吗? IPhone通过USB通信 想学IOS开发,机子怎么解决 求iOS上传图片到服务器代码 求解 UIAlertView UITapGestureRecognizer 点击窗口之外区域关闭 求助贴,请大哥们帮忙看下为什么类的对象数组在tableview显示不出
和nameLabel1.lineBreakMode = NSLineBreakByWordWrapping;
这个我试过了,没用啊
果然,我用的是iOS8,iOS6和iOS8都正常,iOS7.1估计是Bug了
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];