草庐IT

current_color

全部标签

colors - 快速更改拉动以刷新文本颜色

我有一个拉动来刷新我的应用程序。如何更改attributedTitle的文本颜色?refresher.attributedTitle=NSAttributedString(string:"hey!istheresomethingnew?") 最佳答案 尝试varattr=[NSForegroundColorAttributeName:UIColor.greenColor()]refresher.attributedTitle=NSAttributedString(string:"hey!istheresomethingnew?",a

xcode - iOS8.0 的 CompileSwift 状态为 "the current deployment target does not support automated __weak references"

我正努力在Swift应用程序中使用静态库(从ObjectiveC编译)。我有一个包含相关header的ObjectiveC桥接header。构建应用程序时出现此错误../someDirectory/Xcode/FirstSteps/headers/Acme.h:89:thecurrentdeploymenttargetdoesnotsupportautomated__weakreferencesAcme类确实使用弱引用,但部署目标是iOS8.0,它应该支持它们。我是不是找错树了?Acme.h的第89行显示:-(void)addTopicListener:(__weakNSObject*

ios - iOS应用的黑 'background color'可以改吗?

我正在制作一个带有立方体动画的应用程序。当我滑动到另一个ViewController时,会出现黑色背景。有什么解决办法吗?更高级感谢解决!我不知道这是否可能,但有谁知道您是否可以在窗口背景上放置类似svg图像的内容? 最佳答案 objective-C-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions{self.window.backgroundColor=[UIColorora

ios - 苹果 swift : how to get current seconds in 1/100 or 1/1000?

funcupdateTime(){vardate=NSDate()varcalendar=NSCalendar.currentCalendar()varcomponents=calendar.components(.CalendarUnitSecond,fromDate:date)varhour=components.hourvarminutes=components.minutevarseconds=components.secondcounterLabel.text="\(seconds)"varmyIndicator=counterLabel.text?.toInt()ifmyI

colors - 更改 SCNText 节点对象的颜色或纹理(Swift - Scenekit)

如何设置SCNText对象的纹理?这就是我所拥有的,外观没有任何变化://myNodeisaworkingSCNTextelementletmat=SCNMaterial()met.diffuse.contents=UIImage(contentsOfFile:"texture.png")myNode.geometry.firstMaterial=mat 最佳答案 Atextgeometrymaycontainone,three,orfivegeometryelements:IfitsextrusionDepthpropertyis

ios - swift 3.0 : Unable to infer closure type in the current context , PromiseKit

我在swift3.0中有以下代码,我在其中使用PromiseKit。funccalculateTravelTime(from:CLLocation,to:CLLocation)->Promise{Promise{completion,reject->Voidinletrequest=MKDirections.Request()request.transportType=.walkingletfromPlacemark=MKPlacemark(coordinate:from.coordinate)lettoPlacemark=MKPlacemark(coordinate:to.coord

ios - SpriteKit : How can I get the pixel color from a point in SKSpriteNode?

我正在制作一个迷宫游戏,我正在使用SKSpriteNode作为实际的2d迷宫。我想检测用户触摸的SKSpriteNode上的点是黑色还是白色。我制作了一个与SKSpriteNode相同的图像的UIImage,并且我在UIImage上使用一种方法来获取像素信息。但是,与SKSpriteNode相比,UIImage似乎有所偏移。当我在屏幕上移动手指时它返回值,但它是不正确的。我猜UIImage的大小和位置与SKSpriteNode不同。我该如何解决这个问题?我使用以下方法获取像素数据extensionUIImage{funcgetPixelColor(pos:CGPoint)->UICol

ios - UIDevice.current.setValue(value, forKey : "orientation") does not work if phone held in landscape and tilted 45 - 90 degrees

我在用letvalue=UIInterfaceOrientation.landscapeRight.rawValueUIDevice.current.setValue(value,forKey:"orientation")强制呈现ViewController以横向显示。这是导航Controller流程的一部分。这按预期工作,但如果手机横向放置并倾斜45到90度,View将以纵向显示。该方法被调用并且预期值是正确的,但景观没有发生变化。这可以在带有导航Controller的基本项目中重现。有谁知道是什么导致了这种行为? 最佳答案 我也

iOS 启动 Storyboard : How can I change a Tab Bar's tint color?

我在做什么:使用“启动Storyboard”。它非常简单,并且包含一个默认的UITabBarController。我在启动Storyboard和我的应用程序中将选项卡栏的“tintColor”设置为红色。我正在使用Xcode7、iOS9。什么不起作用:启动屏幕使用默认的蓝色iOS色调加载选项卡栏...!然后在加载后,当启动屏幕Storyboard被替换时,色调颜色会切换为红色。您究竟打算如何在Storyboard中设置标签栏的色调?演示项目:http://s000.tinyupload.com/?file_id=73998115878034693063 最佳

ios - Locale.current 在设备上报告错误的语言

我正在尝试在iOS应用程序中设置货币值的格式,并且我正在使用设备上的当前区域设置来使用适当的货币格式。在模拟器中,一切似乎都运行良好:当使用currencyFormatter.locale=Locale.current时,它采用正确的区域设置并以正确的货币格式打印数字。然而,在我的iPhone上,它以法语配置并具有法国区域设置,我希望使用另一种格式(例如:1234,56€)。但它不起作用,并且似乎使用了英文格式样式(例如:€1234,56)。事实上,如果我在设备上打印我的应用程序的当前语言环境,它不会像我期望的那样返回fr_FR:NSLog(Locale.current.identif