You are looking for something like this:
CGFloat newAlpha = 0.7; CGColorRef color = CGColorCreateCopyWithAlpha(self.yourTextField.layer.backgroundColor, newAlpha); [self.yourTextField.layer setBackgroundColor:color];
Or, if you already know the color and want only the current alpha:
CGFloat alpha = CGColorGetAlpha(self.yourTextField.layer.backgroundColor);
source share