-(UIImage *)createColorImage:(UIColor *)color { // 使用顏色建立UIImage CGSize imageSize = CGSizeMake(MAIN_SCREEN_WIDTH, MAIN_SCREEN_HEIGHT); UIGraphicsBeginImageContextWithOptions(imageSize, 0, [UIScreen mainScreen].scale); [color set]; UIRectFill(CGRectMake(0, 0, imageSize.width, imageSize.height)); UIImage *pressedColorImg = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return pressedColorImg; }