【问题标题】:Aligning a subview in a Today widget extension在 Today 小部件扩展中对齐子视图
【发布时间】:2014-11-17 04:29:47
【问题描述】:

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.

并提供以下图片:

如何使用自动布局以编程方式将UILabel 的左边缘与标题的左边缘对齐?或者我应该只是“关注”它?

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

【问题讨论】:

    标签: ios cocoa-touch autolayout ios8


    【解决方案1】:

    查看widgetMarginInsetsForProposedMarginInsets

    这将为您对齐它们。

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-12-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-05-03
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多