简体   繁体   English

今日扩展iOS 10 Swift,显示更少

[英]Today Extension iOS 10 Swift, Show Less

I have a problem with the Today Extension in Swift. 我在Swift中使用Today扩展有问题。 The problem is about the function "show less", it seems that all the buttons and label that I have inside the widget are compressed on them self (keep a look to the screenshot). 问题是关于“少显示”功能的,似乎我在小部件中拥有的所有按钮和标签都被自身压缩(请看一下屏幕截图)。 What can I do? 我能做什么? Some hint? 有什么提示吗? Thank you very much. 非常感谢你。 First image compressed cause Show Less button pressed Expansed widget with Show More pressed 第一个图像被压缩的原因是按下“显示较少”按钮导致 扩展了“显示更多”的小部件

You need to set proper constraints such that it works for both compact as well as expanded mode. 您需要设置适当的约束,以使其既适用于紧凑模式也适用于扩展模式。

I used all the labels to setup my constraints : 我使用了所有标签来设置constraints

在此处输入图片说明

Constrains list that you can use: 可以使用的Constrains列表:

在此处输入图片说明 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM