vis*_*hnu 2 iphone objective-c uitableview ios9
我正面临着UITableView行分隔符的问题.对于替代行,可以看到该行.
将高度为1的UIView添加到单元格将给出解决方案,但这不是正确的方法.以下代码适用于iOS 8,但在9中它表现出不同的性质.
- (IBAction)curencySelect:(id)sender {
currencyTable = [[UITableView alloc]initWithFrame:CGRectMake(29, 257, 265,113) style: UITableViewStylePlain];
}
#pragma mark -
#pragma mark UITableViewDelegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section{
return currencyArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyIdentifier"];
if (cell == nil) {
cell =[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"MyIdentifier"];
}
cell.textLabel.text = [currencyArray objectAtIndex:indexPath.row];
return cell;
}
Run Code Online (Sandbox Code Playgroud)
提前致谢.
归档时间: |
|
查看次数: |
402 次 |
最近记录: |