The color of a rounded rectangle can be changed to any color using the background color property in IB, as well as using coding, but cannot easily change its color to a transparent color. To do this, you better use a custom button with a rounded image or set a layer, as shown in the example, and do not forget to add the Quartz Core structure project to the project, as well as import it into your class.
UIBUtton *myBtn = [UIButton buttonWithType:UIbuttonTypeCustom]; myBtn.frame = frame;
source share