Closed n3d1117 closed 5 years ago
I'm working on better defaults for iPad width, which should be available within the next week or so.
As a quick fix, you could try adding a max width constraint to segue.messageView.backgroundView
.
Hello, Thanks for the quick reply! I tried the fix you mentioned:
segue.messageView.backgroundView.widthAnchor.constraint(lessThanOrEqualToConstant: 600).isActive = true
But it conflicts with other constraints:
Can you try the head of master
and let me know if it works for you? It has improved default sizing on iPad and fixes the Auto Layout error you had. Here are the updated readme notes on sizing:
Sizing
SwiftMessagesSegue
provides static default view controller sizing based on device. However, it is recommended that you specify sizing appropriate for your content using one of the following methods.
- Define sufficient width and height constraints in your view controller.
- Set
preferredContentSize
(a.k.a "Use Preferred Explicit Size" in Interface Builder's attribute inspector). Zeros are ignored, e.g.CGSize(width: 0, height: 350)
only affects the height.- Add explicit width and/or height constraints to
segue.messageView.backgroundView
.Note that
Layout.topMessage
andLayout.bottomMessage
are always full screen width. For other layouts, the there is >a maximum 500pt width on iPad (regular horizontal size class) at 950 priority, which can be overridden by adding higher-priority constraints.
Just tested, it's working now @wtmoose! Great addition to the library, I think you can close this. Thank you!
Fixed in 7.0.0.
Hello, awesome library!
I'm trying to use
SwiftMessagesSegue
with aUITableViewController
inside aUINavigationController
using.centered
layout. So far works fine:However I noticed that the modal goes full width even in landscape and on iPads, making it look way too stretched. Is there any way I can set a max width?
Thanks!