Skip to content

NavigationView creates a black view to appear when using a textfield #43

Open

Description

@Nathan1258

As shown:

ScreenRecording_07-01-2024.22-30-42_1.MP4

Clicking on a textfield will cause a black (or the colour you set config.backgroundColour as within the NavigationGlobalConfig) to appear and fill the entire view.

Activity

  1. FulcrumOne commented on Jul 2, 2024

    @FulcrumOne
    Member

    Hey @Nathan1258,

    The problem should be solved in the "patch-1.1.1" branch. Could you please check it and let me know? Thanks!

  2. Nathan1258 commented on Jul 2, 2024

    @Nathan1258
    Author

    Hi @FulcrumOne,

    I can confirm the problem has been solved - thank you for being so speedy! Nice to see my UI when entering text 🤣

    Will return to stable branch now and wait for patch-1.1.1 to be merged!

  3. added a commit that references this issue on Jul 2, 2024
  4. clbemre commented on Jul 9, 2024

    @clbemre

    Hello @FulcrumOne , I have same problem, and up to date.
    config.backgroundColour = .red

    image
  5. FulcrumOne commented on Jul 10, 2024

    @FulcrumOne
    Member

    @clbemre,
    Hey, I'll look at this at the weekend

    PS. Could you paste here the code I can use to reproduce it? Thanks a million!

  6. clbemre commented on Jul 10, 2024

    @clbemre

    @FulcrumOne Hey thank you, I noticed that also, drag gesture conflicts with scrollview and causes an wrong behavior.

    Additionally maybe you can add view.navigationBackGesture(.dragEdges) 😀

  7. FulcrumOne commented on Jul 10, 2024

    @FulcrumOne
    Member

    @FulcrumOne Hey thank you, I noticed that also, drag gesture conflicts with scrollview and causes an wrong behavior.

    Additionally maybe you can add view.navigationBackGesture(.dragEdges) 😀

    There is such an option, I don't remember how it's called exactly but one of NavigationGlobalConfig 😉

  8. clbemre commented on Jul 11, 2024

    @clbemre

    @FulcrumOne
    I just saw view.navigationBackGesture(.drag). No (.dragEdges), i don't know :)

  9. FulcrumOne commented on Jul 11, 2024

    @FulcrumOne
    Member

    In a file "Public+NavigationGlobalConfig", there should be three attributes - backGesturePosition (the one that you're looking for), backGestureThreshold and backgroundColour. Could you confirm that in the version you use, all three attributes exist?

  10. clbemre commented on Jul 11, 2024

    @clbemre

    @FulcrumOne
    aa okey, i see. We have to configure global config. I thought we could adjust this on a per page basis sorry :)

  11. FulcrumOne commented on Jul 11, 2024

    @FulcrumOne
    Member

    @clbemre,

    Do you think it would be better to add this option to every screen?

  12. clbemre commented on Jul 11, 2024

    @clbemre

    No but I just want to override . And my main problem is not this. My problem in video :)

  13. FulcrumOne commented on Jul 11, 2024

    @FulcrumOne
    Member

    yeah, tomorrow or Saturday I'm returning to this library 😅

  14. 20 remaining items

  15. clbemre commented on Jul 28, 2024

    @clbemre

    @FulcrumOne Hello again.
    Also I have conflick drag gestures.

    I have using this framework. https://github.com/ciaranrobrien/SwiftUIPageView but I got confilict with back gestures.

    Screen.Recording.2024-07-28.at.16.59.33.mov
  16. clbemre commented on Jul 28, 2024

    @clbemre

    My code like that; (i will delete later, sorry @FulcrumOne )

    deleted code

  17. clbemre commented on Jul 31, 2024

    @clbemre

    @FulcrumOne Hello, Did you check it?

  18. FulcrumOne commented on Jul 31, 2024

    @FulcrumOne
    Member

    hey @clbemre,

    I've saved the code (so you can delete it), but currently I'm working on PopupView. Sorry, will return to this issue as soon as I finish the sprint for that library 😉

    P.S. Soon the tasks should be done a bit faster, as we have expanded our team a bit 😉

  19. FulcrumOne commented on Jul 31, 2024

    @FulcrumOne
    Member

    Btw, if you use Discord, you can join our here: https://discord.com/invite/dT5V7nm5SC

    It's not ready yet, but at least we could communicate more effectively with PMs 😅

  20. clbemre commented on Jul 31, 2024

    @clbemre

    @FulcrumOne thank you, I don't have Discord now :) okey I'll be waiting. It is important to solve the problem but there is no rush. 😀

    Best regards.

  21. clbemre commented on Aug 7, 2024

    @clbemre

    @FulcrumOne
    Hello again, how can apply opacity background ?
    view.backgroundColour(Color.brandBlueColor.opacity(0.2)), doesn't work?

  22. clbemre commented on Aug 19, 2024

    @clbemre

    @FulcrumOne Hello, I'm still waiting for this topic. 👀 :)

  23. FulcrumOne commented on Aug 19, 2024

    @FulcrumOne
    Member

    Hey @clbemre,

    Are you sure it doesn't work? I just tried and here's the effect:
    CleanShot 2024-08-19 at 11 41 02
    CleanShot 2024-08-19 at 11 41 33

    P.S. Sorry for not responding, but I'm busy with other libraries currently, and the next time window for this one will be mid-September ;)

  24. clbemre commented on Aug 19, 2024

    @clbemre

    @FulcrumOne I have tried a few thinsg but I wasn't successful.

    CompletedDialogView().push(with: .dissolve)

    Global config

    var navigationConfig: NavigationGlobalConfig {
            var config = NavigationGlobalConfig()
            config.backgroundColour = Color.viewBackgroundColor
            config.backGesturePosition = .edge
            config.backGestureThreshold = 0.25
            return config
        }
    

    View Config

    func configure(view: NavigationConfig) -> NavigationConfig {
            view.backgroundColour(Color.brandBlueColor.opacity(0.2))
    }
    
    // -> no background in contentView
     var body: some View {
            ZStack {
                contentView
                    .padding(20)
            }.frame(maxWidth: .infinity, maxHeight: .infinity)
        }
    
  25. clbemre commented on Sep 12, 2024

    @clbemre

    @FulcrumOne Hello again. Also I have conflick drag gestures.

    I have using this framework. https://github.com/ciaranrobrien/SwiftUIPageView but I got confilict with back gestures.

    Screen.Recording.2024-07-28.at.16.59.33.mov

    @FulcrumOne Hello again, I'm still waiting to hear back from you.

  26. clbemre commented on Oct 14, 2024

    @clbemre

    Hey @FulcrumOne When will you get back to me? We had suspended the project but we've brought it back to the agenda, I don't have much time to wait. (or I will have to change the navigation library.)

  27. FulcrumOne commented on Oct 14, 2024

    @FulcrumOne
    Member

    Hey @clbemre,

    Unfortunately I'm busy with PopupView till the end of this month. The next on my list is CameraView, so I would advise you to change the library.

    Sorry and have a nice day,
    Tomasz

  28. clbemre commented on Oct 14, 2024

    @clbemre

    hey @clbemre,

    I've saved the code (so you can delete it), but currently I'm working on PopupView. Sorry, will return to this issue as soon as I finish the sprint for that library 😉

    P.S. Soon the tasks should be done a bit faster, as we have expanded our team a bit 😉

    You said this before. But it's been so long. thank you. have a nice day.

  29. clbemre commented on Nov 13, 2024

    @clbemre

    Hello @FulcrumOne I found the source of the problem but I need your help to solve it. When I delete the code .padding(.bottom, getPadding(.bottom, item)) in this method, the up and down shaking in the video does not happen anymore, but deleting the code is not a solution, it may break something else.

    func createItem(_ item: AnyNavigatableView) -> some View {
            item.body
                .padding(.top, getPadding(.top, item))
                .padding(.bottom, getPadding(.bottom, item))
                .padding(.leading, getPadding(.leading, item))
                .padding(.trailing, getPadding(.trailing, item))
                .frame(maxWidth: .infinity, maxHeight: .infinity)
                .background(getBackground(item).compositingGroup())
                .opacity(getOpacity(item))
                .scaleEffect(getScale(item))
                .offset(getOffset(item))
                .offset(x: getRotationTranslation(item))
                .rotation3DEffect(getRotationAngle(item), axis: getRotationAxis(), anchor: getRotationAnchor(item), perspective: getRotationPerspective())
                .compositingGroup()
                .disabled(gestureData.isActive)
        }
    

    I tried it but I'm not sure. Maybe it can help you.

    OLD:

    func getPadding(_ edge: Edge.Set, _ item: AnyNavigatableView) -> CGFloat {
            guard let ignoredAreas = getConfig(item).ignoredSafeAreas,
                ignoredAreas.edges.isOne(of: .init(edge), .all)
                else { return screenManager.getSafeAreaValue(for: edge) }
    
            if ignoredAreas.regions.isOne(of: .keyboard, .all) && isKeyboardVisible { return 0 }
            if ignoredAreas.regions.isOne(of: .container, .all) && !isKeyboardVisible { return 0 }
            return screenManager.getSafeAreaValue(for: edge)
    }
    

    SOLUTION(im not sure):

    func getPadding(_ edge: Edge.Set, _ item: AnyNavigatableView) -> CGFloat {
            let currentPadding = screenManager.getSafeAreaValue(for: edge)
            let keyboardPadding = keyboardManager.height > 0 ? 0 : currentPadding
            let containerPadding = isKeyboardVisible ? keyboardPadding : currentPadding
    
            guard let ignoredAreas = getConfig(item).ignoredSafeAreas,
                  ignoredAreas.edges.isOne(of: .init(edge), .all)
            else { return containerPadding }
    
            return ignoredAreas.regions.isOne(of: .keyboard, .all) ? 0 : containerPadding
        }
    

    Best Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions