2016-04-18 17 views
1

tableViewの内部にあるUIViewの高さを変更しようとしています。 UIViewの高さがセルの高さを超えてはいけません。UITableViewCellの中にあるUIViewの高さを変更する

私はviewの境界を設定しようとしましたが、ビューには影響しませんでした。私はこの問題を解決し、view

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 


    UIView *view=(UIView *)[cell viewWithTag:999]; 

    view.backgroundColor=[UIColor redColor]; 
    [view setBounds:CGRectMake(view.bounds.origin.x, view.bounds.origin.y, view.bounds.size.width, 400)]; 

    return cell; 
} 
+0

しかし、背景色は期待どおりに変更されました – gamal

+0

ビューに関連するテーブルセルの高さを増やす必要があります。自動レイアウトを使用している場合は、レイアウト制約を使用します。 –

+0

cellForRowAtIndexPath内のレイアウト制約にアクセスする方法を説明できます – gamal

答えて

関連する問題