[LayaAirIDE 2.0]textinput(type=password)手机打开华为安全键盘后,无法关闭(官网的例子)
(function()
{
var Stage = Laya.Stage;
var TextInput = Laya.TextInput;
var Handler = Laya.Handler;
var WebGL = Laya.WebGL;
var SPACING = 100;
var INPUT_WIDTH = 300;
var INPUT_HEIGHT = 50;
var Y_OFFSET = 50;
var skins;
(function()
{
// 不支持WebGL时自动切换至Canvas
Laya.init(800, 600, WebGL);
Laya.stage.alignV = Stage.ALIGN_MIDDLE;
Laya.stage.alignH = Stage.ALIGN_CENTER;
Laya.stage.scaleMode = Stage.SCALE_SHOWALL;
Laya.stage.bgColor = "#232628";
skins = ["../../res/ui/input (1).png", "../../res/ui/input (2).png", "../../res/ui/input (3).png", "../../res/ui/input (4).png"];
Laya.loader.load(skins, Handler.create(this, onLoadComplete)); //加载资源。
})();
function onLoadComplete()
{
for (var i = 0; i < skins.length; ++i)
{
var input = createInput(skins[i]);
input.prompt = 'Type:';
input.x = (Laya.stage.width - input.width) / 2;
input.y = i * SPACING + Y_OFFSET;
if(i==0){ input.type="password"}
}
}
function createInput(skin)
{
var ti = new TextInput();
ti.skin = skin;
ti.size(300, 50);
ti.sizeGrid = "0,40,0,40";
ti.font = "Arial";
ti.fontSize = 30;
ti.bold = true;
ti.color = "#606368";
Laya.stage.addChild(ti);
return ti;
}
})();
{
var Stage = Laya.Stage;
var TextInput = Laya.TextInput;
var Handler = Laya.Handler;
var WebGL = Laya.WebGL;
var SPACING = 100;
var INPUT_WIDTH = 300;
var INPUT_HEIGHT = 50;
var Y_OFFSET = 50;
var skins;
(function()
{
// 不支持WebGL时自动切换至Canvas
Laya.init(800, 600, WebGL);
Laya.stage.alignV = Stage.ALIGN_MIDDLE;
Laya.stage.alignH = Stage.ALIGN_CENTER;
Laya.stage.scaleMode = Stage.SCALE_SHOWALL;
Laya.stage.bgColor = "#232628";
skins = ["../../res/ui/input (1).png", "../../res/ui/input (2).png", "../../res/ui/input (3).png", "../../res/ui/input (4).png"];
Laya.loader.load(skins, Handler.create(this, onLoadComplete)); //加载资源。
})();
function onLoadComplete()
{
for (var i = 0; i < skins.length; ++i)
{
var input = createInput(skins[i]);
input.prompt = 'Type:';
input.x = (Laya.stage.width - input.width) / 2;
input.y = i * SPACING + Y_OFFSET;
if(i==0){ input.type="password"}
}
}
function createInput(skin)
{
var ti = new TextInput();
ti.skin = skin;
ti.size(300, 50);
ti.sizeGrid = "0,40,0,40";
ti.font = "Arial";
ti.fontSize = 30;
ti.bold = true;
ti.color = "#606368";
Laya.stage.addChild(ti);
return ti;
}
})();
没有找到相关结果
已邀请:
要回复问题请先登录
2 个回复
Aar0n
赞同来自:
为世界献上奇迹
赞同来自:
demo用QQ浏览器扫码,苹果是可以正常变回普通键盘,华为的不行