gpt4 book ai didi

ios - UItableview 的 UICustom 单元格不适合 tableview 宽度

转载 作者:行者123 更新时间:2023-11-28 21:50:51 26 4
gpt4 key购买 nike

enter image description here

我的 UITableViewUICustomCell 不适合 iPhone 6 和 6 + 的 tableview 宽度我已经为它拿了 Nib 。一个用于 iPhone,一个用于 iPad

最佳答案

screenWidth = [UIScreen mainScreen].bounds.size.width;

UITableView *tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, screenWidth, screenHeight) style:UITableViewStylePlain];

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Prototype Cell" forIndexPath:indexPath];
cell.frame.size.width = tableView.frame.size.width;
}

关于ios - UItableview 的 UICustom 单元格不适合 tableview 宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28408038/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com