簡體   English   中英

UITableViewCell中的UITextView-iOS 7

[英]UITextView in UITableViewCell - iOS 7

我有一個帶UITextView的Costum UITableViewCell,但是我的TextView不會調整大小,如果我向下滾動UITextView的內容更改格式!

我的Costum單元的.h文件中有一些對象,但沒有其他對象。

這是我的cellForRowAtIndexPath:

AACTickerYellowCell * cell;

        NSString *cellIdentifier = @"yellowCell";
        cell = (AACTickerYellowCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier];

        if(cell == nil) {
            cell = [[AACTickerYellowCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
        }

        cell.backgroundColor = [[UIColor alloc] initWithRed:1 green:1 blue:1 alpha:1];

        cell.minuteLabel.text = [[dict objectAtIndex: [[dataManager getTickerObjects] count] - 1 - indexPath.row] objectForKey:@"Minute"];

        cell.textView.delegate = self;
        cell.textView.text = [[dict objectAtIndex: [[dataManager getTickerObjects] count] - 1 - indexPath.row] objectForKey:@"Text"];
        cell.textView.textAlignment = NSTextAlignmentLeft;
        cell.textView.font = [UIFont fontWithName:@"Helvetica" size:16];

        return cell;

'dict'在my -viewDidLoad:聲明。

我的兩個問題在哪里,我該如何解決?

您是否已在-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath UITableView委托中調整了單元格的大小?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM