zoukankan      html  css  js  c++  java
  • 表格默认选择某行

    -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
        ProductTypeCell *mProductTypeCell = [tableView dequeueReusableCellWithIdentifier:productTypeindterfier];
        mProductTypeCell.selectedBackgroundView = [[UIView alloc] initWithFrame:mProductTypeCell.frame];
        mProductTypeCell.selectedBackgroundView.backgroundColor  = [UIColor whiteColor];
    //    另外修改字体的颜色
        mProductTypeCell.typeLable.highlightedTextColor = RGB(0x00bdbe);
        ProductListModel *mProductListModel = _dataArray[indexPath.row];
        mProductTypeCell.typeLable.text = [NSString stringWithFormat:@"%@",mProductListModel.productTypeName];
    //默认中    
    [_productTableView selectRowAtIndexPath:[NSIndexPath indexPathForItem:
    0 inSection:0] animated:YES scrollPosition:UITableViewScrollPositionTop]; if ([_productTableView.delegate respondsToSelector:@selector(tableView:didSelectRowAtIndexPath:)]) {
    [_productTableView.
    delegate tableView:_productTableView didSelectRowAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:0]]; } return mProductTypeCell; }
  • 相关阅读:
    LeetCode-20.Valid Parentheses
    LeetCode-2. Add Two Numbers
    LeetCode-1. Two Sum
    LeetCode Top100 Liked Questions
    位运算
    sublime中文乱码解决办法
    jQuery 参考手册
    jQuery 参考手册
    jQuery 参考手册
    《锋利的Jquery第二版》读书笔记 第三章
  • 原文地址:https://www.cnblogs.com/wq-gril/p/6148619.html
Copyright © 2011-2022 走看看