iOS琐碎的知识点

0.分割线

[self.TableViewAccount setSeparatorInset:UIEdgeInsetsMake(0, 20, 0, 20)];

1.tableview点没点都一样

cell.selectionStyle = UITableViewCellSelectionStyleNone;

2.去掉tableview分割线

self.tableViewInstallationDetails.separatorStyle = UITableViewCellSeparatorStyleNone;

3.iOS10 字体显示不全

label.adjustsFontSizeToFitWidth = YES;//iOS10 字显示不全 设置成YES就可以啦

4.button 上的字左对齐

buttonAgreement.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;// 这行代码,把按钮的内容(控件)

5.在button中找cell

ShoppingListCell * cell = (ShoppingListCell *)[_tableViewShoppingList cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i  inSection:0]];


iOS琐碎的知识点_第1张图片

//一个section刷新

NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2];

[tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];

//一个cell刷新

NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0];

[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];

6.后台播放音频的方法


iOS琐碎的知识点_第2张图片

7.添加手势使键盘下落

UITapGestureRecognizer * singleTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(clickSingleTap)];

[self.view addGestureRecognizer:singleTap];

#pragma mark - 手势  键盘下落

-(void)clickSingleTap

{

[self.view endEditing:YES];

}

你可能感兴趣的:(iOS琐碎的知识点)