在“今日”窗口小部件扩展中对齐子视图

时间:2014-09-23 04:49:20

标签: ios cocoa-touch autolayout ios8

Apple建议我们应该:

Align content with the widget’s title. When your widget content aligns with your title, people can easily scan the Today view for the widget they want. Respect the margins in the Today view, and restrain your content to the widget content area shown here.

并提供以下图片:

enter image description here

如何使用autolayout以编程方式将UILabel的左边缘与标题的左边缘对齐?或者我希望只是'眼球'吗?

来源:https://developer.apple.com/LIBRARY/PRERELEASE/IOS/documentation/UserExperience/Conceptual/MobileHIG/AppExtensions.html#//apple_ref/doc/uid/TP40006556-CH67-SW4

2 个答案:

答案 0 :(得分:0)

查看widgetMarginInsetsForProposedMarginInsets

这样做可以让你对齐它们。

答案 1 :(得分:0)

只需将其与您的超级视图左边缘对齐,即小部件内容区域。

相关问题