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);

  • 相关阅读:
    toString的本质 以及String.valueOf()
    css3选择符
    HTML5标签
    css3-动画
    2D功能函数
    css过度
    css渐变
    BFC-块级格式化上下文
    表单补充
    表格补充:
  • 原文地址:https://www.cnblogs.com/Leetvin/p/2730796.html
Copyright © 2011-2022 走看看