how to darken a UIImageView
问题 I need to darken a UIImageView when it gets touched, almost exactly like icons on the springboard (home screen). Should I be added UIView with a 0.5 alpha and black background. This seems clumsy. Should I be using Layers or something (CALayers). 回答1: How about subclassing UIView and adding a UIImage ivar (called image)? Then you could override -drawRect: something like this, provided you had a boolean ivar called pressed that was set while touched. - (void)drawRect:(CGRect)rect { [image