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

  • 相关阅读:
    C#委托 delegate
    认识反射
    【译】修改大XML文件的有效方法
    学习javascript并解读JQuery
    ASP.Net用户验证的实现
    渴望
    C++中常见的一些小问题总结(一)
    struts2:关于EL能够获得action的属性
    排序算法总结
    WebService开发实例
  • 原文地址:https://www.cnblogs.com/Leetvin/p/2730796.html
Copyright © 2020-2023  润新知