Questions tagged «ios»

iOS是在Apple iPhone,iPod touch和iPad上运行的移动操作系统。使用此标签[ios]来解决与iOS平台上的编程有关的问题。使用相关的标签[objective-c]和[swift]解决那些编程语言所特有的问题。





12
如何使用Swift在iOS中从右到左显示视图控制器
我正在使用presentViewController呈现新屏幕 let dashboardWorkout = DashboardWorkoutViewController() presentViewController(dashboardWorkout, animated: true, completion: nil) 这将显示从下到上的新屏幕,但我希望不使用即可从右到左显示UINavigationController。 我使用的是Xib而不是情节提要,该怎么办?
82 ios  swift  swift2  segue 

10
Bundle.main.path(forResource:ofType:inDirectory :)返回nil
尽量不要笑或大哭-离开20年后,我才重新开始编写代码... 我花了4多个小时来查看引用并尝试使用代码片段来获取Bundle.main.path来打开我的文本文件这样我就可以为我的应用读取数据(下一步是适当地解析它)。 if let filepath = Bundle.main.path(forResource: "newTest", ofType: "txt") { do { let contents = try String(contentsOfFile: filepath) print(contents) } catch { print("Contents could not be loaded.") } } else { print("newTest.txt not found.") } 结果是:“找不到newTest.txt。” 无论我如何尝试将文件拖放到项目中,都可以在Xcode中创建文件,也可以使用File-> Add Files to ...菜单项。
82 ios  swift  macos  file  swift3 


15
如何在FlatButton单击时关闭AlertDialog?
我有以下几点AlertDialog。 showDialog( context: context, child: new AlertDialog( title: const Text("Location disabled"), content: const Text( """ Location is disabled on this device. Please enable it and try again. """), actions: [ new FlatButton( child: const Text("Ok"), onPressed: _dismissDialog, ), ], ), ); 我_dismissDialog()该如何解雇说AlertDialog?

15
如何在SwiftUI NavigiationView中删除默认导航栏空间
我是SwiftUI的新手(像大多数人一样),试图弄清楚如何删除我嵌入在NavigationView中的List上方的空白。 在此图像中,您可以看到列表上方有一些空白 我要完成的是 我试过使用 .navigationBarHidden(true) 但这并没有进行任何明显的更改。 我目前正在这样设置我的navigationView NavigationView { FileBrowserView(jsonFromCall: URLRetrieve(URLtoFetch: applicationDelegate.apiURL)) .navigationBarHidden(true) } 其中FileBrowserView是具有列表和像这样定义的单元格的视图 List { Section(header: Text("Root")){ FileCell(name: "Test", fileType: "JPG",fileDesc: "Test number 1") FileCell(name: "Test 2", fileType: "txt",fileDesc: "Test number 2") FileCell(name: "test3", fileType: "fasta", fileDesc: "") } } 我确实要注意,这里的最终目标是您将能够单击这些单元格来更深入地导航到文件树,因此在更深层的导航栏中应该显示“返回”按钮,但是我不希望在在我的初始视图中排名最高。


16
UIView摇动动画
我试图在按下按钮时摇晃UIView。 我正在修改在http://www.cimgf.com/2008/02/27/core-animation-tutorial-window-shake-effect/上找到的代码。 但是,通过尝试修改以下代码来摇晃UIView,它不起作用: - (void)animate { const int numberOfShakes = 8; const float durationOfShake = 0.5f; const float vigourOfShake = 0.1f; CAKeyframeAnimation *shakeAnimation = [CAKeyframeAnimation animation]; CGRect frame = lockView.frame; CGMutablePathRef shakePath = CGPathCreateMutable(); CGPathMoveToPoint(shakePath, NULL, CGRectGetMinX(frame), CGRectGetMinY(frame)); for (int index = 0; index < numberOfShakes; ++index) { CGPathAddLineToPoint(shakePath, NULL, …

10
Facebook SDK:应用未注册为URL方案
我正在使用此处Facebook SDK找到的内容,并且正在尝试提供的示例(在文件夹中)。FacebookiOSSample 如果仅用AppId我的具体内容替换此处AppId,那么我将无法再共享。(我在AppDelegate文件和info.plist文件中都将其替换了)。我现在收到以下错误: FBSDKLog:无效使用FBAppCall,fb ****未注册为URL方案。您是否在plist中设置了“ FacebookUrlSchemeSuffix”? 否则,这与样本的原始AppId文件(指向的名称)可以正常工作IFaceTouch。 我的应用程序设置有什么问题,我该如何注册AppId?

18
在UIView中的两个角
不久前,我发布了一个关于仅将视图的两个角变圆的问题,并得到了很好的答复,但是在实现它时遇到了问题。这是我的drawRect:方法: - (void)drawRect:(CGRect)rect { //[super drawRect:rect]; <------Should I uncomment this? int radius = 5; CGContextRef context = UIGraphicsGetCurrentContext(); CGContextBeginPath(context); CGContextAddArc(context, rect.origin.x + radius, rect.origin.y + rect.size.height - radius, radius, M_PI, M_PI / 2, 1); CGContextAddArc(context, rect.origin.x + rect.size.width - radius, rect.origin.y + rect.size.height - radius, radius, M_PI / 2, 0.0f, …

11
如何在iOS上使用CSS溢出获取滚动条
开发iPad网站时,我尝试使用CSS属性overflow: auto获取滚动条(如果需要)div,但是即使两个手指滚动正常,我的设备也拒绝显示滚动条。 我尝试过 overflow: auto; 和 overflow: scroll; 结果是一样的。 我仅在iPad上进行测试(在桌面浏览器上可以正常运行)。 有任何想法吗?
82 css  ipad  ios 


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.