在代号One中创建类似于iPhone相机功能选择器的内容 [英] Create something similar to the iPhone camera functions selector in Codename One

查看:71
本文介绍了在代号One中创建类似于iPhone相机功能选择器的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此图片中,有iPhone相机功能选择器的屏幕快照:用户可以水平滚动它们,并选择移到中间的功能名称(它更改颜色并调用监听器来激活该功能).在真实的iPhone上测试比描述起来容易.

In this picture, there is a screenshot of the iPhone camera functions selector: the user can horizontally scroll them, and the function name moved to center is selected (it changes its color and it calls a listener that activate the function). It's easier to test on a real iPhone than to describe.

此行为与轻量级字符串选择器非常相似,但是主要区别在于它是水平的并且始终显示(可以打开和关闭字符串选择器).

The behavior is very similar to the lightweight string picker, but the main differences are that it's horizontal and it's always shown (while the string picker can be opened and closed).

此刻,我还不知道如何在Codename One中复制它:我需要将其放在摄像机PeerComponent上.我需要足够"的相似且可用的东西:旋转效果(我想很难复制)非常好,但并非绝对必要.

At the moment, I haven't no idea how to replicate it in Codename One: I need to put it over a camera PeerComponent. I need something "enough" similar and usable: the rotating effect (that I suppose hard to replicate) is very nice but not strictly necessary.

推荐答案

这是 List 没有更好的替代品的情况.请注意,这并未涵盖iOS中的轻微3d效果.您可以通过使用分层布局和渐变淡入淡出的方式在列表顶部进行伪造,但这看起来可能并不好:

This is the one case where List has no better substitute. Notice that this doesn't cover the slight 3d effect in iOS. You can fake it a bit by using a layered layout and gradient fade on top of the list but that might not look great:

Form f = new Form("Horizontal List", new BorderLayout());

DefaultListCellRenderer.setShowNumbersDefault(false);    com.codename1.ui.List<String> l = new com.codename1.ui.List<>("Time-Lapse", "Slo-Mo", "Video", "Foto", "Ritrato");

l.setOrientation(com.codename1.ui.List.HORIZONTAL);
l.setFixedSelection(com.codename1.ui.List.FIXED_CENTER);

f.add(SOUTH, l);

f.show();

这篇关于在代号One中创建类似于iPhone相机功能选择器的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆