草庐IT

convert_alpha

全部标签

ios - 准备 segue : Cannot convert value of type 'UIViewController' to specified type 'SecondViewController'

我知道我肯定在这里遗漏了一些明显的东西,但我似乎无法通过它的实际类型来引用目标ViewController。我按照以下步骤从头开始创建了一个新项目来对此进行测试:创建一个新的单View应用程序项目添加一个新的ViewController创建一个新类,子类化UIViewController,并将其命名为SecondViewController将这个新类设置为第二个ViewController的自定义类(现在它的标题是第二个ViewController)向第一个ViewController添加一个按钮,然后按住Ctrl键单击它到第二个ViewController,然后从ActionSegu

android - 应用程序未针对 Google Play 上的 Alpha 测试人员进行更新

我的应用正在使用GooglePlay进行测试。自然,我是我的alpha测试人员之一。我发布了该应用程序的新alpha版本。我期待它会在我的设备上自动更新。但它没有更新。我错过了一步吗?根据GoogleOncetheyinstalltheappandoptin,they'llautomaticallybeupdatedtothenewtestversion. 最佳答案 GooglePlay没有什么是自动的。他们有一个类似于AppleAppStore的缓存系统。根据我的经验,缓存系统每天会刷新一两次,市场也会更新。在那之后的某个时候,更

android - 应用程序未针对 Google Play 上的 Alpha 测试人员进行更新

我的应用正在使用GooglePlay进行测试。自然,我是我的alpha测试人员之一。我发布了该应用程序的新alpha版本。我期待它会在我的设备上自动更新。但它没有更新。我错过了一步吗?根据GoogleOncetheyinstalltheappandoptin,they'llautomaticallybeupdatedtothenewtestversion. 最佳答案 GooglePlay没有什么是自动的。他们有一个类似于AppleAppStore的缓存系统。根据我的经验,缓存系统每天会刷新一两次,市场也会更新。在那之后的某个时候,更

ios - swift 3.1 : Cannot convert value of type '(_) -> ()' error/Problems with closures

我升级到Swift3.1,我收到了一些新错误,这些错误似乎是3.1语法问题,因为在迁移之前它们不是问题。它们大多与闭包有关,如本例所示:letalert=UIAlertController(title:"Success",message:"Thanksforparticipatinginourraffle!",preferredStyle:UIAlertControllerStyle.alert)alert.addAction(UIAlertAction(title:"OK",style:.default,handler:{performSegue(withIdentifier:"to

swift - 错误 : Cannot convert value of type 'URL' to expected argument type 'String'

我在将URL转换为字符串时遇到问题。getScreenShotDirectory()路径是file:///Users/Pat/Desktop/。我的目标是将其转换为字符串,因此路径可以类似于/Users/Pat/Desktop/leturlString=getScreenShotDirectory()letpathURL=URL(string:getScreenShotDirectory())!//error如果需要,我很乐意提供更多代码。 最佳答案 看来您的getScreenShotDirectory()方法已经是一个URL。因此

ios - SpriteKit 背景 PNG,Alpha 显示黑色

我有一个用Swift制作的Spritekit游戏,当游戏结束时,我有一个背景,它是一个png文件,其alpha值为0.5ish(所以它透视)。我是用Photoshop制作的。我用它来淡化游戏细节并将记分卡放在它的顶部。当我在运行iOS9.2的iPhone6上使用它时,它运行良好,使细节变暗并显示记分卡...但是当我在运行iOS9.2的模拟器或运行iOS8.4的iPhone5C上运行它时,它只是出现黑色...覆盖整个游戏屏幕...声明如下://alpha'sdpngcreatedinphotoshop.approx.0.3alphaletbackdrop=SKSpriteNode(ima

swift - 创建透明渐变并将其用作 SpriteKit 中的 alpha 蒙版

我正在尝试制作渐变并将其用作alpha蒙版。现在,我可以制作与此类似的图像(从黑色到透明):这是我用来制作这一切的代码:privatefunccreateImage(width:CGFloat,height:CGFloat)->CGImageRef?{ifletciFilter=CIFilter(name:"CILinearGradient"){letciContext=CIContext()ciFilter.setDefaults()letstartColor=CIColor(red:0,green:0,blue:0,alpha:0)letendColor=CIColor(red:0

struct - 错误 : 'Int' is not convertible to '@lvalue Float'

给定以下函数:funcgreatestCommonDenominator(first:Int,second:Int)->Int{returnsecond==0?first:greatestCommonDenominator(second,first%second)}还有一个包含以下内容的结构:structFraction{varnumerator:Intvardenominator:Intfuncreduce(){letgcd=greatestCommonDenominator(numerator,denominator)self.numerator/=gcdself.denomina

xcode - 快速 Xcode 单元测试 : Cannot convert value of type "Person" to expected argument type "Person"

我正在尝试编写一个单元测试类来测试我的自定义类。当我尝试使用自定义对象作为输入变量调用自定义类中的方法时,我得到:'无法将类型“Person”的值转换为预期的参数类型“Person”。“Person”是从NSManagedObject继承的类,输入对象是从中创建的。我对采用其他值类型的其他方法没有问题。该方法工作正常。测试类是唯一提示这个的。这是错误还是限制?有什么建议可以让我更深入地研究这个问题吗? 最佳答案 我之前遇到过这个问题。事实证明,被测系统(在我的例子中是调用对象的服务;对于您的示例,可能是PersonService)没

swift - iOS Swift 错误 : 'T' is not convertible to 'MirrorDisposition'

我正在尝试为Array类型创建一个扩展方法,以允许从数组中删除一个项目extensionArray{funcremove(item:AnyObject){forvari=self.count-1;i>=0;i--{ifself[i]==item{self.removeAtIndex(i)}}}}关于测试条件ifself[i]==item,我收到以下错误:'T'isnotconvertibleto'MirrorDisposition'我尝试过很多不同的东西,包括:使用泛型:remove(item:T)使用===运算符,它只给出错误'T'doesnotconformtoprotocol'A