gpt4 book ai didi

java - 在 Android 应用程序代码中实现验证码

转载 作者:行者123 更新时间:2023-11-30 02:56:29 27 4
gpt4 key购买 nike

我必须在我的 android 应用程序代码中实现验证码,但在 java 类中有很多错误...

我做了这个例子:

https://github.com/floydfix/Android-Easy-Captcha

字段 Captcha.height 在这行中不可见:

this.height

方法 TextCaptcha(int, int, int, TextCaptcha.TextOptions) 未定义类型 TextCaptcha in:

public TextCaptcha(int wordLength, TextOptions opt){
TextCaptcha(0, 0, wordLength, opt);
}

字段 Captcha.width 在以下情况下不可见:

im.setLayoutParams(new LinearLayout.LayoutParams(c.width *2, c.height *2));

构造函数 MathCaptcha(int, int, MathCaptcha.MathOptions) 未定义在:

Captcha c = new MathCaptcha(300, 100, MathOptions.PLUS_MINUS_MULTIPLY); 

请有人能帮我解决这个问题或指定一个真正有效的脚本吗?

最佳答案

嘿@Hamamelis,当你将项目导入到你的eclipse时,你应该做以下事情,在相应的类中更改以下代码

this.setHeight(height);

在 Mathcaptcha 类中,然后

(c.getWidth() *2, c.getHeight() *2)

在 CaptchatestActivity 中,您要做的最后一件事是将方法名称从

更改为
TextCaptcha(0, 0, wordLength, opt);

TextCaptch(0, 0, wordLength, opt);

在 TextCapctha 类中,将该方法的返回类型设置为 void。

关于java - 在 Android 应用程序代码中实现验证码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23172082/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com