简体   繁体   English

iOS 8小部件对齐问题

[英]iOS 8 Widget Alignment Issue

I'm having trouble aligning an iOS 8 widget all the way to the left. 我在将iOS 8小部件一直向左对齐时遇到问题。 It seems that setting the x origin to 0 still keeps a certain amount of space between the left edge of the screen and my first view. 似乎将x原点设置为0仍然在屏幕的左边缘和我的第一个视图之间保留了一定的空间。

I'm not sure how Evernote does this, but it seems that they have it figured out. 我不确定Evernote如何做到这一点,但似乎他们已经弄清楚了。 Any suggestions? 有什么建议么? I also tried setting the x position programmatically to no success. 我还尝试以编程方式将x位置设置为未成功。

在此处输入图片说明

Here the answer: 这里的答案:

    // MARK: NCWidgetProviding protocol methods

func widgetMarginInsetsForProposedMarginInsets(defaultMarginInsets: UIEdgeInsets) -> UIEdgeInsets
    {
        return UIEdgeInsetsZero
    }

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

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