草庐IT

IOS-Debug

全部标签

ios - 在 iOS 中获取谷歌地图的中心

我在我的应用程序中添加了一个谷歌地图。它显示了从源到目的地的路径。我还想显示估计的时间,该路径的长度如下:如何使用谷歌地图计算路径中心?感谢您抽出宝贵时间!提前致谢... 最佳答案 试试这个...让coordinateA=CLLocation(latitude:55.0,longitude:35.0)设坐标B=CLLocation(纬度:65.0,经度:73.0)让distanceInMeters=coordinateA.distance(from:coordinateB)计算距离后,使用此公式计算速度。即速度=距离/时间试试这个委

ios - 返回事件在 swift 3.0 中的哪里

我想在返回时刷新整个页面Controller。我正在使用代码导航ViewController。我的代码letGTC=self.storyboard?.instantiateViewController(withIdentifier:"GoToCart")as!GoToCartself.navigationController?.pushViewController(GTC,animated:true) 最佳答案 使用viewWillAppear重新加载您的UI。当您使用navigationController?.pushViewCo

ios - 添加手势识别器以允许在 Swift 中的 MapView 上水平滑动

我正在开发一个使用snapchat样式导航系统的应用程序,用户可以在其中在ViewController之间水平滑动。问题是其中一个ViewController是map,一旦用户滚动到map,他们就不能向后滚动,因为map将所有手势解释为与map相关。我如何实现水平滑动手势控件,允许用户水平滑动(从右到左)以离开mapViewController? 最佳答案 解决方案是在mapView上添加边到边手势识别器。这些识别器将跨越View的垂直和水平边缘,当用户从屏幕的最边缘滑动时,将切换snapchat导航系统

ios - Texture ASButtonNode,如何在文字右边设置图片

这样可以自定义标题和图片的距离 最佳答案 你可以使用ASOverlayLayoutSpec。像这样。------------ASOverlayLayoutSpec------------|-ASInsetLayoutSpecASInsetLayoutSpec|||ASButtonNode||ASImageNode|||-----------------------------------|-------------------------------------------引用http://texturegroup.org/docs

iOS App 返回到之前的 UIViewController 时崩溃

我在这个问题(link)中遇到了同样的问题,但在我的例子中,我使用的是AVPlayerViewController而不是MPMoviePlayerController,所以我尝试应用相同的答案的逻辑,但AVPlayer只有未知、readyToPlay和失败状态,我不知道Controller何时关闭。我怎么知道AVPlayerViewController何时关闭或我该如何解决由方向引起的相同崩溃?我的ViewController定位方法:overridevarshouldAutorotate:Bool{returnfalse}overridevarsupportedInterfaceOr

ios - 如何在 ios 中维护登录 session ?

我想知道在应用程序编程中我需要在哪里更改RootViewController。下面是我的代码classNavigationViewController:UINavigationController{varwindow:UIWindow?overridefuncviewDidLoad(){super.viewDidLoad()letstoryBoard=UIStoryboard(name:"Main",bundle:nil)letnewRootView=storyBoard.instantiateViewController(withIdentifier:"WelcomeViewCont

ios - 检查弃用警告和新方法

最近我在AppStore上提交了我的应用程序,方法是设置tabbaritem的badgecolor。[[[AppDelegateglobalDelegate].tabBarControllerviewControllers]objectAtIndex:1].tabBarItem.badgeColor=kTabBarBadgeColor;此badgeColor仅在iOS10中出现,我的应用程序支持iOS8及更高版本。我对此一无所知,该应用程序获得了批准。现在,我必须重新提交我的应用以解决此问题。我想知道是否有办法找出方法被弃用或仅在特定操作系统版本中可见的情况。

ios - 在我的表格 View 中设置单元格时索引超出范围

在我的表格View中设置单元格时,我遇到了这个问题:日志:*Terminatingappduetouncaughtexception'NSRangeException',reason:'*-[__NSArrayMobjectAtIndex:]:index5beyondbounds[0..4]'***Firstthrowcallstack:(0x18696afd80x1853cc5380x1868491f00x100918a300x10091960c0x18cddf1140x18cddf32c0x18cdcca300x18cde431c0x18cb7c92c0x18ca971580x18

ios - 带有平移、旋转和捏合手势的 UIKit Dynamics

我已将UIDynamics添加到imageview并为此使用了平移手势。它在平移手势上工作正常,但是当我应用捏手势时它不起作用。它显示大ImageView,但当我开始拖动时,它会更改为原始大小。这是我的代码:funchandleAttachmentGesture(_sender:UIPanGestureRecognizer){letlocation=sender.location(in:emojiSuperView!)letboxLocation=sender.location(in:self)switchsender.state{case.began:print("Yourtouch

ios - 为 ios react-native itc deploy 加载 ios/main.bundle js 时遇到问题

我正在尝试为我的ios应用程序首次部署到itc,该应用程序现在包含一个react-nativeView。我使用创建了包react-nativebundle--entry-fileindex.ios.js--platformios--devfalse--bundle-outputios/main.jsbundle--assets-destios但我似乎无法弄清楚切换jsCodeLocation以使用新包的语法。我找到的大多数指南都在obj-c中,无法弄清楚我的命令有什么问题。当我在这里设置断点时,我发现它返回jsCodeLocationnil。funcloadReactNativeVie