美文网首页
实现tableViewCell高度自适应(内嵌UITextVei

实现tableViewCell高度自适应(内嵌UITextVei

作者: 琳琅满目浪迹天涯 | 来源:发表于2022-07-25 16:49 被阅读0次

iOS进度条圆形 水平 竖直带动画

- (void)textViewDidChange:(UITextView *)textView {
    
    CGRect bounds = textView.bounds;
    
    // 计算 text view 的高度
    CGSize maxSize = CGSizeMake(bounds.size.width, CGFLOAT_MAX);
    
    CGSize newSize = [textView sizeThatFits:maxSize];
    
    bounds.size = newSize;
    
    textView.bounds = bounds;
    
    UITableView *tableView = [self tableView];
    
    [tableView beginUpdates];
    
    [tableView endUpdates];
}


        _tableView.rowHeight = UITableViewAutomaticDimension;
        _tableView.estimatedRowHeight = 44;
    static func swiftSubString(formart: String...) -> String {
        var result = ""
        
        for params in formart {
            result += params
        }
        return result
    }
+ (NSString *)subString:(NSString *)formart, ... {
    va_list args;
    va_start(args, formart);
    NSString *subStr = [[NSString alloc] initWithFormat:formart arguments:args];
    va_end(args);
    NSLog(@"%@", subStr);
    return subStr;
}

相关文章

网友评论

      本文标题:实现tableViewCell高度自适应(内嵌UITextVei

      本文链接:https://www.haomeiwen.com/subject/ccdvfrtx.html