Giter VIP home page Giter VIP logo

Comments (7)

elijah-semyonov avatar elijah-semyonov commented on June 6, 2024 2

Thanks, I'll have a look

from compose-multiplatform.

elijah-semyonov avatar elijah-semyonov commented on June 6, 2024 2

@alexstyl
Yes, I reproduced it. Investigating.

from compose-multiplatform.

elijah-semyonov avatar elijah-semyonov commented on June 6, 2024 1

UIApplication.shared is illegal to access in App Extensions and we still wrongfully do it in order to ensure, that no drawing happens when app is in background (which it says it is, it's UB most likely anyway). Working around it will also require us to update Skia. The version we use still performs MtlIsAppInBackground check (which does the same thing) and wrongfully exits not even trying to perform the draw logic.

This is possible to fix, but a bit later. We didn't plan supporting such a feature and didn't do any sort of investigations, so there are some implications in existing code (regarding lifecycle, etc).

from compose-multiplatform.

elijah-semyonov avatar elijah-semyonov commented on June 6, 2024

Can you try to rewrite this code using the anchor constraints instead of autoresize mask? It seems to me that the size could be calculated incorrectly in this code.

from compose-multiplatform.

alexstyl avatar alexstyl commented on June 6, 2024

I tried this code and the result is the same:

let rootView = ComposeView()
            .frame(maxWidth: .infinity, maxHeight: .infinity)
            .background(Color.white)
        let controller = UIHostingController(rootView: rootView)
               
        self.addChild(controller)

        controller.view.translatesAutoresizingMaskIntoConstraints = false
        self.view.addSubview(controller.view)
        
        controller.view.leadingAnchor.constraint(equalTo: self.view.leadingAnchor).isActive = true
        controller.view.trailingAnchor.constraint(equalTo: self.view.trailingAnchor).isActive = true
        controller.view.topAnchor.constraint(equalTo: self.view.topAnchor).isActive = true
        controller.view.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true
        
        controller.didMove(toParent: self)

from compose-multiplatform.

alexstyl avatar alexstyl commented on June 6, 2024

Keep in mind that I tried the same code to render a Swift View and the contents of the Swift View were displayed correctly.

from compose-multiplatform.

alexstyl avatar alexstyl commented on June 6, 2024

@elijah-semyonov did u have a look? could you kindly confirm that is indeed a bug in compose?

from compose-multiplatform.

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.