React Native:构建一个“从列表中选择项目"成分 [英] React Native: Build a "Select Item from List" component

查看:139
本文介绍了React Native:构建一个“从列表中选择项目"成分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在屏幕内建立一个选择器菜单".我认为时间选择器弹出组件使用起来不够流畅,因为它们需要额外的点击,而不仅仅是拖动到所需的元素上.

I want to build a "Picker Menu" inside a screen. I think the time picker popup components are not smooth enough to use, because they require extra clicks instead of just dragging to the wanted element.

该组件应返回所选值 +更改所选值的颜色.我想到了ListView/ScrollView,但找不到找到工作的方法.

The component should return the selected value + change the color of the selected value. I thought of ListView/ ScrollView, but I couldn't find a way to get that working yet.

以下:一个精美的gimp图形,用于显示目标,将Android时间选择器放置在屏幕内作为视觉示例.

Below: A great gimp graphic to show what the goal is, placing the Android Time Picker inside the screen as visual example.

这就是它的样子

任何想法从哪里开始?如何使用React-Native组件构建类似的东西?

Any ideas where to start? How can I build something like this with the React-Native components?

推荐答案

您可以使用 react-native-wheel-picker react-native-wheel-picker-android .这些库在不打开任何弹出窗口的情况下提供了拾轮器.

You can use react-native-wheel-picker or react-native-wheel-picker-android. These libraries provide wheel picker without opening any popup.

这篇关于React Native:构建一个“从列表中选择项目"成分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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