【发布时间】:2021-07-07 15:13:36
【问题描述】:
我正在尝试使用 Nativescript 的 ListPicker 在我的 ios/android 应用程序中收集数据。我遇到了一个问题,它不是显示每个单独的字符串或数字,而是将所有内容分解为单独的字符。
例如,我想给用户一个左或右选项,但list picker 显示每个字符,而不是左和右两个选项。 Click here for the image of this
我在尝试使用list picker 显示数字列表时遇到了同样的问题,因为它将数字分解为单个字符并在中间添加了数组中的逗号。我试图让用户在这里选择一个高度。 Click here for the image of this
我正在使用native script-angular。
代码如下:
HTML 文件:
<ListPicker items="{{ sides }}" ></ListPicker>
<StackLayout orientation="horizontal">
<ListPicker items="{{ feet }}" ></ListPicker>
<ListPicker items="{{ inches }}" ></ListPicker>
</StackLayout>
TypeScript 文件:
sides = ["Left", "Right"];
feet = [1, 2, 3, 4, 5, 6, 7];
inches = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
我以前从未使用过 ListPicker,所以我可能会错误地使用它,但根据我的研究,这个执行应该可以正常工作。如果有人有解决办法,我将不胜感激!
【问题讨论】:
标签: android ios angular nativescript nativescript-angular