ios app适配暗黑模式 苹果暗黑模式适配_ios


ipad和iphone适配


ios app适配暗黑模式 苹果暗黑模式适配_macos_02

Khamosh Pathak Khamosh Pathak

Dark mode is everywhere from Mac, Windows, Android, and now on the iPhone and iPad. iOS 13 and iPadOS 13 finally brings the much-coveted feature to Apple’s devices. It looks great, and it automatically works with supported apps and websites.

从Mac,Windows, Android到现在在iPhone和iPad上无处不在的黑暗模式。 iOS 13iPadOS 13终于为苹果的设备带来了令人垂涎的功能。 它看起来很棒,并且可以自动与受支持的应用程序和网站一起使用。

(How to Enable Dark Mode on iPhone and iPad)

When you enable dark mode, the entire UI on your iPhone or iPad flips. You now see a black background and white text. Apple has gone with a true black theme which means that the background at most places is pure black instead of a dark gray.

启用暗模式时,iPhone或iPad上的整个UI都会翻转。 现在,您将看到黑色背景和白色文本。 苹果采用了真正的黑色主题,这意味着大多数地方的背景都是纯黑色而不是深灰色。


ios app适配暗黑模式 苹果暗黑模式适配_ios app适配暗黑模式_03

Khamosh Pathak Khamosh Pathak

This looks great on iPhones with an OLED display (iPhone X, XS, XS Max, 11, and 11 Max) as the pixels just don’t light up. To maintain readability, Apple has gone for a gray background for some background elements. We’ve talked about the intricacies of the dark mode interface in detail before.

在配备OLED显示屏的iPhone(iPhone X,XS,XS Max,11和11 Max)上,这看起来很棒,因为像素不会点亮 。 为了保持可读性,Apple为某些背景元素使用了灰色背景。 之前,我们已经详细讨论了暗模式界面的复杂性

So let’s get to the nitty-gritty. To enable the dark mode on your iPhone or iPad, first, open the Control Center.

因此,让我们开始讨论。 要在iPhone或iPad上启用暗模式,请首先打开“ 控制中心”

If you have an iPhone X-style device with a notch, swipe down from the top-right edge of the screen. The same goes for iPad users. If you’re using an iPhone with a Home button, swipe up from the bottom of the screen to open Control Center.

如果您的iPhone X样式的设备带有缺口,请从屏幕的右上边缘向下滑动。 iPad用户也是如此。 如果您使用带主屏幕按钮的iPhone,请从屏幕底部向上滑动以打开“控制中心”。


ios app适配暗黑模式 苹果暗黑模式适配_macos_04


Here, tap and hold on the “Brightness” slider.

在这里,点击并按住“亮度”滑块。


ios app适配暗黑模式 苹果暗黑模式适配_ios_05


Now, tap on the “Dark mode” button to turn it on. If you want to disable the feature, you can tap on the icon again.

现在,点击“黑暗模式”按钮将其打开。 如果要禁用该功能,可以再次点击该图标。


ios app适配暗黑模式 苹果暗黑模式适配_ios_06


Alternatively, you can turn dark mode on or off through the Settings menu. You can do this by going to Settings > Display and tap on “Dark.”

另外,您可以通过“设置”菜单打开或关闭暗模式。 您可以转到“设置”>“显示”,然后点击“暗”。

(Add a Dark Mode Toggle to the Control Center)

If you’re like me, you’ll want a dedicated switch for dark mode. It’s available as an additional toggle in Control Center.

如果您像我一样,则需要专用于黑暗模式的开关。 可以在“控制中心”中将其作为附加切换项使用。

To enable it, go to Settings > Control Center > Customize Controls.

要启用它,请转到“设置”>“控制中心”>“自定义控件”。


ios app适配暗黑模式 苹果暗黑模式适配_android_07


From this screen, tap on the “+” button next “Dark mode.”

在此屏幕上,点击“黑暗模式”旁边的“ +”按钮。


ios app适配暗黑模式 苹果暗黑模式适配_ios_08


This will enable the dedicated dark mode toggle at the end of the Control Center. Tap on the button to toggle dark mode on and off. There’s no more need to go to the brightness menu!

这将在控制中心的末尾启用专用的暗模式切换。 点击按钮可打开或关闭暗模式。 不再需要去亮度菜单!


ios app适配暗黑模式 苹果暗黑模式适配_ios_09


(Set Dark Mode on a Schedule)

You can also automate the dark mode feature by setting up a schedule. Open the “Settings” app and go to “Display and Brightness.”

您还可以通过设置时间表来自动设置暗模式。 打开“设置”应用,然后转到“显示和亮度”。

From the “Appearance” section, tap on the toggle next to “Automatic.”

在“外观”部分,点击“自动”旁边的切换按钮。


ios app适配暗黑模式 苹果暗黑模式适配_python_10


Then tap on the “Options” button to switch between the “Sunset to Sunrise” option and a “Custom Schedule” option.

然后点击“选项”按钮,在“从日落到日出”选项和“自定义时间表”选项之间切换。


ios app适配暗黑模式 苹果暗黑模式适配_macos_11


If you choose the “Custom Schedule” option, you’ll be able to specify the precise time dark mode should kick in.

如果您选择“自定义时间表”选项,则可以指定黑暗模式应进入的确切时间。

(Dark Mode Works With Compatible Apps and Websites)

Just like macOS Mojave, the dark mode on iPhone and iPad works with supported apps and websites.

就像macOS Mojave一样 ,iPhone和iPad上的暗模式可与受支持的应用和网站一起使用。

Once an app updates for iOS 13 and supports this feature, it will automatically switch the app’s theme to dark theme when you turn on the system dark mode from Control Center.

应用更新为iOS 13并支持此功能后,当您从Control Center打开系统暗模式时,它将自动将应用的主题切换为暗主题。

Here, for example, is the LookUp Dictionary app. In the left screenshot, the app is in the default light mode. And on the right, you can see what the app looks like in dark mode.

例如,这里是LookUp Dictionary应用程序。 在左侧的屏幕截图中,该应用程序处于默认的灯光模式。 在右侧,您可以看到应用程序在黑暗模式下的外观。


ios app适配暗黑模式 苹果暗黑模式适配_ios_12


All I did between these two screenshots was to go to the Control Center and turn on dark mode. Once apps start supporting this feature, you won’t need to find the dark mode feature in individual apps.

在这两个屏幕截图之间,我所做的就是去控制中心并打开暗模式。 应用开始支持此功能后,您将无需在单个应用中找到暗模式功能。

The same goes for Safari. If a website supports the dark mode feature in CSS, it will automatically switch between the light and the dark themes based on the system settings.

Safari也是如此。 如果网站支持CSS中的深色模式功能,它将根据系统设置自动在浅色和深色主题之间切换。

In the screenshot below, you can see the feature in action for the Twitter website in Safari.

在下面的屏幕截图中,您可以看到Safari中Twitter网站的实际功能。


ios app适配暗黑模式 苹果暗黑模式适配_ios_13


Currently, there’s no way to blacklist apps from this automatic theme switching feature.

当前,无法通过此自动主题切换功能将应用列入黑名单。

But for websites, you can disable the feature altogether by going to Settings > Safari > Advanced > Experimental Features and turning off the “Dark mode CSS support” option.

但是对于网站,您可以通过转到设置> Safari>高级>实验性功能并关闭“暗模式CSS支持”选项来完全禁用该功能。

(Alternative To Dark Mode: Smart Invert)

The automatic dark mode will only work for apps that support the feature in iOS 13, iPadOS 13, and above. What if you want to enable dark mode in an app that doesn’t support it? Use the Smart invert feature as a workaround.

自动暗模式仅适用于支持iOS 13,iPadOS 13及更高版本中的功能的应用。 如果要在不支持的黑暗模式下启用该模式怎么办? 使用智能反转功能作为解决方法。

Smart invert is an accessibility feature that automatically inverts the UI colors without touching the images and other media. With this workaround, you can get a decent white-text-on-black-background interface.

智能反转是一种可访问性功能,可以自动反转UI颜色,而无需触摸图像和其他媒体。 通过这种解决方法,您可以获得一个不错的黑色背景上的白色文本界面。

To enable it, go to Settings > Accessibility > Display and Text Size and then toggle on “Smart Invert.”

要启用它,请转到“设置”>“辅助功能”>“显示和文本大小”,然后打开“智能反转”。


ios app适配暗黑模式 苹果暗黑模式适配_ios_14


You can see the difference between a website in light mode and with Smart invert turned on in the screenshots below. Although most of the website inverts correctly, some areas—such as the menu bar in the below example—don’t look like they should.

您可以在下面的屏幕截图中看到一个网站在轻量模式下与启用了智能反转的区别。 尽管大多数网站都可以正确转换,但是某些区域(如以下示例中的菜单栏)看起来并不理想。


ios app适配暗黑模式 苹果暗黑模式适配_android_15


Granted, the Smart invert feature doesn’t work for everything, but it’s a good alternative. If a developer doesn’t add dark mode to their app(s), this (somewhat) works.

诚然,智能倒置功能并不能解决所有问题,但这是一个不错的选择。 如果开发人员未在其应用程序中添加暗模式,则此方法(某种程度上)可行。

翻译自: https://www.howtogeek.com/440078/how-to-enable-dark-mode-on-your-iphone-and-ipad/

ipad和iphone适配