Codenameone 使用SwipeBacksupport滑动表单会将整个屏幕变为白色
在滑动窗体时,屏幕左侧的增长部分仅为白色,直到滑动完成,最后绘制“返回”窗体。这是故意的吗?我希望“回归”的形式要么逐渐显露,要么从左边滑进来Codenameone 使用SwipeBacksupport滑动表单会将整个屏幕变为白色,codenameone,swipe,Codenameone,Swipe,在滑动窗体时,屏幕左侧的增长部分仅为白色,直到滑动完成,最后绘制“返回”窗体。这是故意的吗?我希望“回归”的形式要么逐渐显露,要么从左边滑进来 在iOS和Android上,被刷卡的表单似乎也会变成白色,因此整个屏幕在刷卡结束之前都是白色的。然而,模拟器的情况并非如此,在模拟器中,您可以看到表单,直到它被完全刷出 复制行为的代码: Form redForm = new Form("Red Form"); redForm.getAllStyles().setBgColor(0xff0
Form redForm = new Form("Red Form");
redForm.getAllStyles().setBgColor(0xff0000);
Button btnToBlueForm = new Button("Go to blue form");
redForm.add(btnToBlueForm);
Form blueForm = new Form("Blue Form");
blueForm.getAllStyles().setBgColor(0x0000ff);
LazyValue<Form> lazyRedForm = (Object... args) -> redForm;
SwipeBackSupport.bindBack(blueForm, lazyRedForm);
btnToBlueForm.addActionListener((ActionListener<ActionEvent>) (ActionEvent evt) -> {
blueForm.show();
SwipeBackSupport.bindBack(blueForm, lazyRedForm);
});
redForm.show();
formredform=新表格(“红色表格”);
redForm.getAllStyles().setBgColor(0xff0000);
按钮btnToBlueForm=新按钮(“转到蓝色表单”);
redForm.add(btnToBlueForm);
表格蓝色表格=新表格(“蓝色表格”);
blueForm.getAllStyles().setBgColor(0x0000ff);
LazyValue lazyRedForm=(对象…参数)->redForm;
SwipeBackSupport.bindBack(blueForm、lazyRedForm);
btnToBlueForm.addActionListener((ActionListener)(ActionEvent evt)->{
blueForm.show();
SwipeBackSupport.bindBack(blueForm、lazyRedForm);
});
redForm.show();
按红色的按钮。蓝色窗体现在显示。向后轻扫并观察效果。这是因为转换中的SlideFade模式。如果您将其切换为幻灯片,则应能在背景中正常工作。下面是一个版本的代码,通过将样式应用于内容窗格,它可以按预期工作:
Form redForm = new Form("Red Form");
redForm.getContentPane().getAllStyles().setBgColor(0xff0000);
redForm.getContentPane().getAllStyles().setBgTransparency(255);
Button btnToBlueForm = new Button("Go to blue form");
redForm.add(btnToBlueForm);
Form blueForm = new Form("Blue Form");
blueForm.getContentPane().getAllStyles().setBgColor(0x0000ff);
blueForm.getContentPane().getAllStyles().setBgTransparency(255);
LazyValue<Form> lazyRedForm = (Object... args) -> redForm;
SwipeBackSupport.bindBack(blueForm, lazyRedForm);
btnToBlueForm.addActionListener((ActionListener<ActionEvent>) (ActionEvent evt) -> {
blueForm.show();
SwipeBackSupport.bindBack(blueForm, lazyRedForm);
});
redForm.show();
formredform=新表格(“红色表格”);
redForm.getContentPane().getAllStyles().setBgColor(0xff0000);
redForm.getContentPane().getAllStyles().SetbGTTransparency(255);
按钮btnToBlueForm=新按钮(“转到蓝色表单”);
redForm.add(btnToBlueForm);
表格蓝色表格=新表格(“蓝色表格”);
blueForm.getContentPane().getAllStyles().setBgColor(0x0000ff);
blueForm.getContentPane().getAllStyles().SetbGTTransparency(255);
LazyValue lazyRedForm=(对象…参数)->redForm;
SwipeBackSupport.bindBack(blueForm、lazyRedForm);
btnToBlueForm.addActionListener((ActionListener)(ActionEvent evt)->{
blueForm.show();
SwipeBackSupport.bindBack(blueForm、lazyRedForm);
});
redForm.show();
与原始代码不同的是,SlideFade是两个独立的转换,一个移动/淡入标题,另一个单独滑动内容窗格。由于内容窗格是透明的,因此不会绘制背景,因为我们假定它是表单背景。通过设置内容窗格的颜色/不透明度,我们可以在SlideFade将“看到”的图层上获得完全相同的效果。抱歉,但代码没有任何差异。我刷卡的时候屏幕还是空白的。我只在安卓系统上测试过,我测试过,它对我有效。这是在模拟器上进行的还是仅在设备上进行的?在模拟器上,至少可以看到表单正在白色背景上拖动。在Android和iOS上,屏幕保持白色,直到拖动结束。我在Windows10上的NetBeans中工作,这个项目是基于一个“Hello World”cn1模板,其中包含原生的NetBeans。链接到屏幕录制:iOS:,模拟器下的Windows 10:OK,我看到一个问题。我正在调查我找到了它,修复了它,它应该是本周五下一次更新的一部分