|
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
|
|
|
BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.
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.