推送视图应该以透明背景出现 [英] pushed view should appear with transparent background

查看:31
本文介绍了推送视图应该以透明背景出现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是从一个视图推另一个视图.在此代码之后,推送的视图将显示为透明.我之前用过很多次.就这么简单.

settings *set = [[settings alloc] initWithNibName:@"settings" bundle:nil];set.view.backgroundColor = [[UIColor blueColor] colorWithAlphaComponent:0.3f];[self.navigationController pushViewController:设置动画:是];

但是现在有了最新的 iosxcode ,推视图不再透明.所以如果有人对此有任何其他解决方案,请告诉我.

我已经参考了很多关于这个的帖子

  • 解决方案

    你应该展示你的 view controller 而不是 push,因为使用 push,你不能实现透明显示以前的视图控制器!

    您可以调试视图层次结构以检查您的顶视图和上一个视图之间有多少视图.

    要调试视图层次结构,您可以点按 Debug View Hierarchy 按钮 来自调试区!

    I am just pushing another view from one view . the pushed view would appear transparent after this code . i have used it many times earlier . it is as simple as this .

    settings *set = [[settings alloc] initWithNibName:@"settings" bundle:nil];
    set.view.backgroundColor = [ [UIColor blueColor] colorWithAlphaComponent:0.3f];
    [self.navigationController pushViewController:set animated:YES ];
    

    But now with latest ios and xcode , pushed view does not become transparent anymore . so if anyone has any other solution for this then please let me know .

    I already referred many posts regarding this like

    and asked to many other members , but could not get the solution for this issue .

    解决方案

    You should present your view controller instead of push, because with push, you can not achieve transparency that shows previous view controller!

    You can debug view hierarchy to just check that how much views are between your top view and previous view.

    To debug view hierarchy you can tap Debug View Hierarchy button from debug area!

    这篇关于推送视图应该以透明背景出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆