【发布时间】:2016-01-25 12:44:11
【问题描述】:
android 中的浮动操作按钮是不错的选择。我想在我的代号应用程序中使用它。我已经通过使用 LayeredLayout 进行了尝试,有两种布局。我无法完美地实现它。按钮随着滚动条不断移动。如何在不影响背景层滚动时将按钮固定在屏幕右下角。
这是我的尝试。
Form myForm = new Form();
myForm.setLayout(new LayeredLayout());
myForm.setTitle("Floating Action Button");
SpanLabel lbl = new SpanLabel("some long text");
Container conBottom = new Container();
conBottom.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
conBottom.addComponent(lbl);
FlowLayout flow = new FlowLayout(Component.RIGHT);
flow.setValign(Component.BOTTOM);
Container conUpper = new Container(flow);
conUpper.addComponent(new Button("+"));
conUpper.setScrollable(false);
myForm.addComponent(conBottom);
myForm.addComponent(conUpper);
myForm.show();
这是类似于我想要实现的链接。 https://github.com/Clans/FloatingActionButton 请帮忙! 谢谢!
【问题讨论】:
标签: codenameone floating-action-button