I am unable to control the background color of a UITextField with a borderStyle= UITextBorderStyleRoundedRect. With this border style the ba

The other answers don't have the shadows present on a UITextField with Rounded Rectangle style. After trying many options I finally just placed a UIView over the UITextField, with an identical frame and auto resize mask, set the alpha to 0.3, and set the background to a blue color. Then I used the snippet from Peter Johnson's answer to clip the rounded edges off the colored overlay view. Also, uncheck the 'User Interaction Enabled' checkbox in IB to allow touch events to cascade down to the UITextField underneath. Looks perfect now.
Side effect: your text will also be colorized (doesn't matter if it's black)
#import
colorizeOverlayView.layer.cornerRadius = 6.0f;
colorizeOverlayView.layer.masksToBounds = YES;