Giter Site home page Giter Site logo

Comments (16)

nickoneill avatar nickoneill commented on June 27, 2024

Original reporter doesn't know any other special options turned on, definitely not reduced transparency. It's a SE.

from ios.

mccarron avatar mccarron commented on June 27, 2024

@nickoneill Did you find out what iOS version they are on?

from ios.

inuwali avatar inuwali commented on June 27, 2024

@mccarron I'm seeing this on my iPhone 7 running 10.2.1.

There's a difference in the view hierarchy when I run on device versus when I run on sim (seeing proper effect).

Sim: UIVisualEffectView has three subviews: _UIVisualEffectBackdropView, _UIVisualEffectFilterView, _UIVisualEffectContentView

Device: UIVisualEffectView has one subview: _UIVisualEffectContentView

from ios.

mccarron avatar mccarron commented on June 27, 2024

@inuwali Does it always happen or is it fixed if you force quit the app?

from ios.

inuwali avatar inuwali commented on June 27, 2024

It is 100% reproducible, right from a cold launch. I'm currently trying swapping out the storyboard instance for a programmatic one to see if that has any impact.

from ios.

subdigital avatar subdigital commented on June 27, 2024

@inuwali Does this happen as a result of the view swapping animation that happens here? https://github.com/5calls/ios/blob/master/FiveCalls/FiveCalls/AppDelegate.swift#L41

from ios.

mccarron avatar mccarron commented on June 27, 2024

@inuwali Also you can try to debug the issue with this command in the debugger:

po [visualEffectView _whatsWrongWithThisEffect]

(in this case visualEffectView is actually headerView in that class)

Source: https://forums.developer.apple.com/message/76154#76153

from ios.

inuwali avatar inuwali commented on June 27, 2024

@mccarron Thanks for the tip; unfortunately having trouble as a Swift newbie getting this to work in LLDB. Have tried:

expr self.headerView._whatsWrongWithThisEffect()
expr -l swift -- self.headerView._whatsWrongWithThisEffect()
expr -l objC -- [self.headerView _whatsWrongWithThisEffect]
expr -l swift -- self.headerView.perform(Selector("_whatsWrongWithThisEffect")) (this one gives back (Unmanaged<AnyObject>?) $R2 = (_value = AnyObject @ 0x00007fd9eb017500) which I can't cast)

from ios.

inuwali avatar inuwali commented on June 27, 2024

@subdigital I'll check that to see.

from ios.

inuwali avatar inuwali commented on June 27, 2024

@subdigital No; since this happens after first run when that function is never called.

from ios.

inuwali avatar inuwali commented on June 27, 2024

@mccarron @subdigital

Adding these lines to IssuesContainerViewController.viewDidLoad() worked:

    let replacement = UIVisualEffectView(frame: self.headerView.frame)
    let contents = (self.headerView as! UIVisualEffectView).contentView.subviews[0]
    contents.removeFromSuperview()
    replacement.contentView.addSubview(contents)
    NSLayoutConstraint.activate([
        replacement.contentView.topAnchor.constraint(equalTo: contents.topAnchor),
        replacement.contentView.bottomAnchor.constraint(equalTo: contents.bottomAnchor),
        replacement.contentView.leftAnchor.constraint(equalTo: contents.leftAnchor),
        replacement.contentView.rightAnchor.constraint(equalTo: contents.rightAnchor)
        ])
    
    replacement.effect = UIBlurEffect(style: .light)
    
    view.insertSubview(replacement, belowSubview: headerView)
    
    NSLayoutConstraint.activate([
        view.topAnchor.constraint(equalTo: replacement.topAnchor),
        view.leftAnchor.constraint(equalTo: replacement.leftAnchor),
        view.rightAnchor.constraint(equalTo: replacement.rightAnchor),
        NSLayoutConstraint(item: replacement, attribute:.height, relatedBy:.equal, toItem:nil, attribute:.notAnAttribute, multiplier:1, constant: 120)
        ])
    
    headerView.removeFromSuperview()
    headerView = replacement

So I assume that there's some storyboard loading problem.

from ios.

subdigital avatar subdigital commented on June 27, 2024

@inuwali I tried this but get some duplicate constraint warnings.

I think it might be worth moving the visual effect view entirely in code and simply have a 120pt tall container w/ the content view (with logo, location button, etc) defined in the storyboard. Then in viewDidLoad we can wake up and wrap the header view in the effect view.

Do you want to take a stab at this and send a PR?

from ios.

inuwali avatar inuwali commented on June 27, 2024

@subdigital
Yeah, the code I posted was just a trial to see if programmatic implementation would work. I'm happy to work on the solution and submit a PR.

from ios.

inuwali avatar inuwali commented on June 27, 2024

@subdigital PR forthcoming. FYI, I had to reverse one of your recent commits to get things working properly after I merged in the latest from upstream. It's commented.

from ios.

inuwali avatar inuwali commented on June 27, 2024

@subdigital @mccarron The PR is up.

from ios.

subdigital avatar subdigital commented on June 27, 2024

Closing, tracking on #85.

from ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.