zoukankan      html  css  js  c++  java
  • iOS开发-UIColor转UIIamge方法

    只能说太神奇了,完美应用到我的毕业设计

    - (UIImage*) createImageWithColor: (UIColor*) color
    {
        CGRect rect=CGRectMake(0,0,self.view.bounds.size.width,64);
        UIGraphicsBeginImageContext(rect.size);
        CGContextRef context = UIGraphicsGetCurrentContext();
        CGContextSetFillColorWithColor(context, [color CGColor]);
        CGContextFillRect(context, rect);
        UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
        return theImage;
    }

    与UIpagecontrol所控制的子视图配合使用,如果你的navigationBar的背景颜色要与子视图一致,那么使用以上方法会达到美妙的效果

  • 相关阅读:
    1069.查找学生信息
    1023.Excel排序
    1061.成绩排序
    bzoj 1113
    bzoj 1112 treap树
    bzoj 1225 dfs + 一点点数论
    bzoj 1224
    UESTC
    HDU 3530 单调队列
    bzoj 1233
  • 原文地址:https://www.cnblogs.com/jierism/p/5951968.html
Copyright © 2011-2022 走看看