zoukankan      html  css  js  c++  java
  • UITableView阴影

    CGColorRef darkColor = [[UIColor blackColor] colorWithAlphaComponent:.5f].CGColor;
    CGColorRef lightColor = [UIColor clearColor].CGColor;

    //Footer shadow
    UIView *footerShadow = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 10)];

    CAGradientLayer *bottomShadow = [[[CAGradientLayer alloc] init] autorelease];
    bottomShadow.frame = CGRectMake(0,0, self.view.frame.size.width, 10);
    bottomShadow.colors = [NSArray arrayWithObjects:(id)darkColor, (id)lightColor, nil];
    footerShadow.alpha = 0.6;

    [footerShadow.layer addSublayer:bottomShadow];
    tb.tableFooterView = footerShadow;

    //Header shadow
    UIView *headerShadow = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 10)];

    CAGradientLayer *topShadow = [[[CAGradientLayer alloc] init] autorelease];
    topShadow.frame = CGRectMake(0, 0, self.view.frame.size.width, 10);
    topShadow.colors = [NSArray arrayWithObjects:(id)lightColor, (id)darkColor, nil];
    headerShadow.alpha = 0.3;

    [headerShadow.layer addSublayer:topShadow];
    tb.tableHeaderView = headerShadow;

    tb.contentInset = UIEdgeInsetsMake(-10, 0, 0, 0);

  • 相关阅读:
    GitHub 实现多人协同提交代码并且权限分组管理
    前端第一篇文章-http标准
    介绍Android电量
    音频编码格式
    PPT
    Word
    HTML 之 JavaScript
    HTML 之 CSS
    HTML 之 HTTP 协议(请求协议以及响应协议)
    HTML 之 标签
  • 原文地址:https://www.cnblogs.com/Leetvin/p/2730796.html
Copyright © 2011-2022 走看看