简体   繁体   English

当我的应用程序中的位置服务关闭时,如何显示包含设置+取消按钮的UIAlertView?

[英]How to present UIAlertView which contains Settings + Cancel button when location services are turned off in my app?

In one of my app I'm using Location Services. 在我的一个应用中,我正在使用位置服务。 I'm throwing a normal alert view whenever the location services are off like "Enable Your Location Services" with "OK" button when I open my app. 打开我的应用程序时,每当关闭位置服务(例如通过“确定”按钮的“启用您的位置服务”)时,我都会抛出正常的警报视图。 But I don't want this. 但我不要这个。 Rather I need to show the alert view as "Turn on Location Services to Allow Your_App_Name to Determine Your Location" with "Settings" and "Cancel" button as shown in the image. 相反,我需要使用“设置”和“取消”按钮将警报视图显示为“打开位置服务以允许Your_App_Name确定您的位置”,如图所示。 Give me the suggestions with a sample code, Thanks. 用示例代码给我建议,谢谢。 在此处输入图片说明

You should just pop up an UIAlertView telling the user that needs to enable Location Services. 您应该只弹出一个UIAlertView,告诉用户需要启用定位服务。

If you want to be more precise, you can always create a new View explaining the user how to enable location Services using graphical content, that makes it so much easier for the user. 如果您想更加精确,则始终可以创建一个新视图,向用户解释如何使用图形内容启用位置服务,这对用户而言非常容易。

You cannot open the Settings page from your app, and if you could, your app would be rejected on the app store. 您无法从应用程序打开“设置”页面,如果可以的话,您的应用程序将在应用商店中被拒绝。

暂无
暂无

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

相关问题 iOS:从设置中关闭位置服务后,是否可以通过设置按钮禁用默认警报弹出窗口 - iOS: Can I disable the default alert pop-up with settings button when location services is turned off from settings 如果我开启了位置服务,那么进入后台模式后如何杀死我的应用? - If I have location services turned on then how can my app get killed when it enters background mode? iOS - 使用“设置”和“取消”按钮打开“位置服务” - “如何捕获取消”按钮单击 - iOS - Turn on Location Services with Settings and Cancel buttons -How do I Capture Cancel button click UIAlertView取消按钮使应用程序崩溃 - UIAlertView cancel button crashes app 如果关闭位置服务,CLLocationManager永远不会更新 - If location services is turned off, CLLocationManager never updates 当用户关闭并打开iPhone设置中的位置服务时,iOS应用会自动重新启动 - iOS app relaunches automatically when user turn off and on the location services in iPhone settings iOS应用程序要求用户两次尝试在关闭位置服务的情况下访问位置时打开位置服务 - iOS application asking the user two times to turn on location services when trying to access location with the location services turned off iPhone定位服务已关闭,但应用程序仍可以获取位置吗? - iPhone Location Services is turned off, but the application can still get the location? 如何在 Swift5 中关闭应用程序时更改应用程序状态? - How to change the app status when the app is turned off in Swift5? 如何判断用户是否为我的应用关闭了蜂窝数据? - How to tell if the user turned off cellular data for my app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM