|
For some reason, my Xcode Swift Canvas Live Preview window refuses to expand vertically beyond a certain height, even though the content inside requires a taller window. Some content, such as multi-line text, even becomes cut-off as a result : I tried selecting a different Preview mode ( see buttons on bottom left of preview pane ), but it still does not allow resizing ( including by selecting an dragging on the corners ) : I've also tried adding some code as described in
But the Canvas Live Preview window still remains short and does not expand vertically. Running the code results in good UI display in a resizable window : But, the full UI content still does not display properly in the Xcode Canvas Live Preview. Is there a way to make the Xcode Canvas Live Preview window larger ? Please note, I selected macOS App at the start of the project : I do not have any code that would be limiting vertical window height. And I am using Xcode Version 15.0.1 (15A507) on macOS 14.1. Thank you. |
|
I've made a test code to try to isolate the problem, and, as far as I could tell, for some reason the window within Xcode Canvas Live Preview refuses to expand vertically beyond around 18 vertical lines. Please see screenshot - see how 40 lines have been coded for display, but only 18 lines are shown in the Xcode Canvas Live Preview : Below is my test code in its entirety. Other than adding
Does anyone see the same results with the same test code ? I selected macOS App at the time of creating the project. And I am using Xcode Version 15.0.1 (15A507) on macOS 14.1. Thank you. |
|
Hi @jayswift, I see the same result with the test code you provided, i found 2 ways to see all rows in the preview,
1- is adding
or 2- adding a fixed layout trait to the preview macro
|
|
|
TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.