iOS状态栏触摸返回到应用程序 [英] iOS Status Bar touch to return to App

查看:383
本文介绍了iOS状态栏触摸返回到应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是令我困惑的是,有谁有任何想法如何去做这个?在Facebook应用程序启动FB Messenger时,图像中的蓝色发光状态栏





对不起,巨大的形象!如果有任何人可以指向正确的方向,那将是伟大的

解决方案

它似乎是一个位于导航顶部的自定义视图具有自定义风格标题的酒吧:触摸返回到Facebook
导航栏有一个应用的动作,当用户点击导航栏时,执行以下代码来打开所需的应用程序,在这种情况下是facebook。



它使用iPhone url方案,您可以直接从应用程序直接从应用程序打开应用程序,如果用户安装了应用程序。



像这样:

  [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@fb:]]; 
//和而不是fb:如果你想要它打开您的自定义应用程序,
//你只需添加自己的方案,就像这样myappscheme:

要为自己的应用程序设置一个方案,请按照以下说明执行来自本网站


  1. 定义应用程式的自订网址方案全部完成Info.plist文件,点击文件中的最后一行,然后点击右侧的+号,添加新行。选择新项目的网址类型。添加后,点击网址类型旁边的灰色箭头显示项目0。将您的URL标识符设置为一个唯一的字符串 - 像com.yourcompany.yourappname。


  2. 设置URL标识符后,选择该行,然后单击再次添加+号,并为URL方案添加新项目。然后点击URL方案旁边的灰色箭头显示项目0。将项目0的值设置为您的URL方案名称。



This is puzzling me, does anyone have any idea how to go about doing this? The blue glowing status bar as in the image as what the Facebook app does when launching FB Messenger

Sorry bout the huge image!!! Would be great if anyone could point me to the right direction

解决方案

It seems like a custom view that sits on top of the navigation bar with a custom stylised title: Touch to return to facebook. The navigation bar has an action applied to it so that when the user taps the navigation bar, the following code is executed to open the desired application, in this case facebook.

It uses the iPhone url scheme, whereby you can open up an application on the device directly from your app if the user has the application installed.

like this:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"fb:]];
//and instead of fb: if you'd want it to open your custom app, 
//you simply add your own scheme instead: like so myappscheme:

To set a scheme for your own app follow the following instructions taken from this site

  1. Defining your app's custom URL scheme is all done in the Info.plist file. Click on the last line in the file and then click the "+" sign off to the right to add a new line. Select URL Types for the new item. Once that's added, click the grey arrow next to "URL Types" to show "Item 0". Set your URL identifier to a unique string - something like com.yourcompany.yourappname.

  2. After you've set the URL identifier, select that line and click the "+" sign again, and add a new item for URL Schemes. Then click the grey arrow next to "URL Schemes" to reveal "Item 0". Set the value for Item 0 to be your URL scheme name.

这篇关于iOS状态栏触摸返回到应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆