大佬教程收集整理的这篇文章主要介绍了ios – 透明视图在另一个透明的UIView上有不透明的内容?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
创建包含并保存整个对话框的边界视图.此视图本身没有可见内容,其BACkgroundColor很清晰.它的alpha是1.0.
现在将所有透明视图(具有alpha< 1的视图)添加到您想要的视图中,并添加非透明视图.注意不要将任何非透明视图添加为透明视图的子视图,而是将它们添加为边界视图的直接子视图.这样,他们将继承其1.0的alpha值.
UIView *progressDialogView = [[UIView alloc] initWithFrame:dialogFrame]; progressDialogView.BACkgroundColor = [UIColor clearColor]; progressDialogView.alpha = 1.0; //you can leave this line out,since this is the default. UIView *halfTransparentBACkgroundView = [[UIView alloc] initWithFrame:dialogFrame]; halfTransparentBACkgroundView.BACkgroundColor = [UIColor blackColor]; //or whatever... halfTransparentBACkgroundView.alpha = 0.5; [progressDialogView addSubview: halfTransparentBACkgroundView]; UIView *progressBarView = [[UIView alloc] initWithFrame:progressBarFrame]; progressBarView.BACkgroundColor = [UIColor blueColor]; [progressDialogView addSubview: progressBarView];
以上是大佬教程为你收集整理的ios – 透明视图在另一个透明的UIView上有不透明的内容?全部内容,希望文章能够帮你解决ios – 透明视图在另一个透明的UIView上有不透明的内容?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。