Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 UILabel 是从数据库中的数据填充的。数据是这样进来的:
LV:7:00 AM - 10:00 PM,S:7:00 AM - 10:00 PM,D:9:00 AM - 10:00 PM
我希望它环绕逗号,所以 UILabel 看起来像这样:
LV:7:00 AM - 10:00 PM, S:7:00 AM - 10:00 PM, D:9:00 AM - 10:00 PM
尝试:
myLabel.text = [myString stringByReplacingOccurrencesOfString:@"," withString:@",\n"];
我想到了。我没有将 UILabel 设置为超过 1 行。