我正在开发一个 Iphone 应用程序。
我正在创建一个 UIView:
UIView *popupView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 250, 250)];
然后我想使用图像作为视图的背景:
UIColor * bgColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"blue_bg.png"]];
popupView.backgroundColor = bgColor;
有没有办法让背景半透明?可能将 alfa 值设置为 0.5 或给它一个不透明度。
我尝试使用 Photoshop 使图像透明,但是当我将其设置为背景时,它不再透明。
请注意,我只需要背景透明而不是子视图
非常感谢您的帮助