Image on imageView



UIImage *carSelectImage = [UIImage imageNamed:@"addCar_ Body color selected "];

carSelectImage = [carSelectImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]



Copy the code

The image on button is rendered



// First change the type of button to CUSTOME

UIButton *customButton = [UIButton buttonWithType:UIButtonTypeCustom];

// Change the image type to keep it round

UIImage *carSelectImage = [UIImage imageNamed:@" image "];

        [button setImage:[carSelectImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateSelected];



Copy the code