UILabel文字的竖向排列

  • (void)setLabel{
    NSString *title = @"请竖向排列!!";
    UILabel *lable = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 20, 200)];
    lable.center = self.view.center;
    lable.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:lable];
    NSString *titleStr = @"";
    for (int i=0; i<[title length]; i++)
    {
    NSString *str = [title substringWithRange:NSMakeRange(i, 1)];

      titleStr = [NSString stringWithFormat:@"%@\n%@",titleStr,str];
    

    }
    lable.text = titleStr;
    lable.numberOfLines = [lable.text length];
    }

推荐阅读更多精彩内容