Tarvo Mäesepp
Tarvo Mäesepp

Reputation: 4533

Today Widget is too big on devices that are on lower IOS than 10

I have problem that the today extension is way too big on IOS versions lower that 9. But it is exactly how I want on greater or equal to IOS 10 devices. And also it is misplaced on the IOS 9 devices.

The constraints I have are the following:

  1. Center vertically,
  2. Center horizontally,
  3. Fixed height(200),
  4. Fixed width(200)

This is how it looks on IOS10+

enter image description here

And it looks like this on IOS9

enter image description here

What could cause the issue?

Upvotes: 1

Views: 198

Answers (1)

PGDev
PGDev

Reputation: 24341

Try this:

For iOS-8 and iOS-9

func widgetMarginInsets(forProposedMarginInsets defaultMarginInsets: UIEdgeInsets) -> UIEdgeInsets
{
    return UIEdgeInsets.zero
}

For iOS-10

It is handled automatically.

For more refer to: https://github.com/pgpt10/Today-Widget

Upvotes: 2

Related Questions