码迷,mamicode.com
首页 > 其他好文 > 详细

4-16学习

时间:2015-04-16 19:33:38      阅读:104      评论:0      收藏:0      [点我收藏+]

标签:

 

tableView左边分割线的解决办法

 

(void) viewDidLoad {

/**

     *  tableView左边分割线短的解决办法

     */

    if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {

        [self.tableView setSeparatorInset:UIEdgeInsetsZero];

        }

    if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)]) {

        

        [self.tableView setLayoutMargins:UIEdgeInsetsZero];

        

    }

 

}

/*

    tableView代理方法

 */

//将要展示Cell视图回调

- (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath

{

    /**

     *  tableView左边分割线短的解决办法

     */

    if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {

        

        [cell setSeparatorInset:UIEdgeInsetsZero];

        

    }

    

    if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {

        

        [cell setLayoutMargins:UIEdgeInsetsZero];

        

    }

}

 

// 选中状态的回调(选中了某个cell就会调用)

- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

{

    // 点击选中后,手指放开会由选中状态有动画的渐渐恢复非选中状态

    [self.tableView deselectRowAtIndexPath:indexPath animated:YES];

 

}

4-16学习

标签:

原文地址:http://www.cnblogs.com/pocket-mood/p/4432896.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!