GithubHelp home page GithubHelp logo

Doesn't work about partialsheet HOT 3 CLOSED

andreamiotto avatar andreamiotto commented on July 20, 2024
Doesn't work

from partialsheet.

Comments (3)

easiwriter avatar easiwriter commented on July 20, 2024 1

I think the problem might be due to scroll views - my sheet is embedded in one. However, I have found an alternative that does work at https://gist.github.com/Amzd/9ec1ee39dca840420ce35505ef360632

from partialsheet.

ElyesDer avatar ElyesDer commented on July 20, 2024

Nope, it’s working normally. But maybe you need to provide us with some code so you can get help.

from partialsheet.

easiwriter avatar easiwriter commented on July 20, 2024

Here is some code and some screenshots. I thought that .partialSheet was intended to be a drop in - that's what the readMe suggests.

Shot 1 shows the sheet that is already working. Shot 4 shows the navBar with the button used to activate it (the wand icon). Shot 2 shows the navBar with .partialSheet. Shot 3 shows it after making the view the first responder - the button has vanished, so you can't display the sheet.

Here is the code for the button using sheet.

        Button(action: ({
            if self.textView.isFirstResponder {
                self.$fontSize.wrappedValue = Int(self.styleModel.getStyleChanges().fontSize)
                self.showModal.toggle()
            }
            else {
                self.showAlert.toggle()
            }
        })) {
            Image(systemName: "wand.and.stars")
                .foregroundColor(Color("WriteNowColor"))
                .imageScale(.large)
        }.padding()
        .sheet(isPresented: $showModal) {
            StyleEditor(styleModel: self.styleModel,
                        allFonts: self.allFonts,
                        textView: self.$textView,
                        fontSize: self.$fontSize,
                        version: self.version)
        }.alert(isPresented: self.$showAlert, content: { self.alert })

The code using partialSheet is the same with .sheet(isPresented: $showModal) changed to .partialSheet(presented: $showModal)

shot 1.pdf
shot 2.pdf
shot 3.pdf
shot 4.pdf

from partialsheet.

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.