Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to create a custom UITableViewCell separator in iOS

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.26k
    Comment on it

    In UITableView every UITableViewCell contains a separator line by default. If you need to create your own custom separator line then use below code inside cellForRowAtIndexPath method.

    UIView* separatorLineView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 8)];
    separatorLineView.backgroundColor = [UIColor colorWithRed:211.0/255.0 green:214.0/255.0 blue:219.0/255.0 alpha:1.0];
    [cell.contentView addSubview:separatorLineView];
    

    You can reduce the height of the separator line also. Hope this will help you.

    Happy Coding!!!

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: