scenee / FloatingPanel

A clean and easy-to-use floating panel UI component for iOS
MIT License
5.6k stars 508 forks source link

Dynamic resizing #650

Open DolganovAnton13 opened 2 weeks ago

DolganovAnton13 commented 2 weeks ago

Description

I support dynamic font resizing. And I want the panel to be able to dynamically resize, too.

Expected behavior

When changing the settings (increasing or decreasing the font), the panel changes its size.

Actual behavior

The panel does not change its size.

Steps to reproduce

Show the panel on the screen ![Simulator Screenshot - new iPhone 15 - 2024-10-16 at 23 11 12](https://github.com/user-attachments/assets/1eb1b8af-5cb6-43a3-b84b-be87527b4848)
Minimize the application. Open the settings (Large Text) and change the size. ![image](https://github.com/user-attachments/assets/cdbfd463-8620-4154-bb29-1e7c503dc1ef)
Deploy the application. The size of the content should change, but the panel does not. ![image](https://github.com/user-attachments/assets/c04ea1f7-326a-41dc-abd9-bce95045125b)

Code example that reproduces the issue

I tried calling the invalidateLayout and invalidateIntrinsicContentSize methods, but it didn't help

class MyFPC: FloatingPanelController {
  override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()
    invalidateLayout()
    surfaceView.invalidateIntrinsicContentSize()
  }
}

How do you display panel(s)?

How many panels do you displays?

Environment

Library version

Installation method

iOS version(s)

Xcode version

scenee commented 2 weeks ago

Thank you for your report. I'll take a look later.