提问人:siflJebatkundy 提问时间:10/11/2023 最后编辑:siflJebatkundy 更新时间:10/13/2023 访问量:72
UIActivityViewController 引发错误
UIActivityViewController is throwing error
问:
我遇到了UIActivityViewController的问题。当我尝试通过以下方式共享图像时:
let activityViewController = UIActivityViewController(activityItems: [UIImage(named: "image")], applicationActivities: nil)
我收到错误:
2023-10-11 09:45:33.759783+0200 Neview[16037:1721794] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x6000006c60d0 _UIActivityActionCellTitleLabel:0x15c5a3750.height >= 22 (active)>",
"<NSLayoutConstraint:0x6000006c5b80 _UICollectionViewListCellContentView:0x15c5a1ec0.height >= _UIActivityActionCellTitleLabel:0x15c5a3750.height + 30 (active)>",
"<NSLayoutConstraint:0x6000006c2850 'UIView-Encapsulated-Layout-Height' _UICollectionViewListCellContentView:0x15c5a1ec0.height == 30 (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x6000006c60d0 _UIActivityActionCellTitleLabel:0x15c5a3750.height >= 22 (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
但是,如果我将UIActivityViewController参数更改为UIImage()以外的其他参数,例如:
let activityViewController = UIActivityViewController(activityItems: [MyCustomUIView()], applicationActivities: nil)
它停止出现错误。
有人知道是什么原因导致了这个问题吗?
答: 暂无答案
评论