Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is an extra safe area scroll for table view #606

Closed
Zeynal7 opened this issue Aug 28, 2023 · 2 comments
Closed

There is an extra safe area scroll for table view #606

Zeynal7 opened this issue Aug 28, 2023 · 2 comments

Comments

@Zeynal7
Copy link

Zeynal7 commented Aug 28, 2023

Description

When I try to scroll the table view, it has extra scroll at the bottom. I checked its height and it is 34 pixel which matches safe area.

I have tried the following, but none of them worked

tableView.insetsContentViewsToSafeArea = false
tableView.contentInsetAdjustmentBehavior = .never
set header and footer height to 0

Expected behavior

Scroll should stop when end of content is reached

Actual behavior

Scroll continues for extra 34 pixels.

Steps to reproduce

Code example that reproduces the issue

I have updated one of the samples - AdaptiveLayoutTestViewController - https://github.com/Zeynal7/FloatingPanelDemo

Screen.Recording.2023-08-28.at.14.04.17.mov

Environment

Library version

Installation method

Version 2.7.0 with SPM

iOS version(s)

Tested on 16.4 and 17.0
Only reproducible with devices that have safe area

Xcode version

14.3

@Zeynal7 Zeynal7 changed the title Removing extra safe area scroll from table view There is an extra safe area scroll for table view Aug 28, 2023
@scenee
Copy link
Owner

scenee commented Aug 29, 2023

This issue can be resolved by applying this patch.

diff --git a/Examples/Samples/Sources/UseCases/UseCaseController.swift b/Examples/Samples/Sources/UseCases/UseCaseController.swift
index a8fd6f6..62f39a6 100644
--- a/Examples/Samples/Sources/UseCases/UseCaseController.swift
+++ b/Examples/Samples/Sources/UseCases/UseCaseController.swift
@@ -248,7 +248,7 @@ extension UseCaseController {
         case .showAdaptivePanelWithCustomGuide:
             let fpc = FloatingPanelController()
             fpc.isRemovalInteractionEnabled = true
-            fpc.contentInsetAdjustmentBehavior = .always
+            fpc.contentInsetAdjustmentBehavior = .never
             fpc.surfaceView.appearance = {
                 let appearance = SurfaceAppearance()
                 appearance.cornerRadius = 6.0

This is because FloatingPanelController automatically sets a content inset as its safe area if fpc.contentInsetAdjustmentBehavior is set to .always :)

@Zeynal7
Copy link
Author

Zeynal7 commented Aug 29, 2023

I see. Thank you.

@Zeynal7 Zeynal7 closed this as completed Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants