demoA.tsx 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import GradientText from "@/components/basic/GradientText";
  2. import { View, PickerView, PickerViewColumn } from "@tarojs/components";
  3. import { useEffect, useLayoutEffect, useRef, useState } from "react";
  4. import { LayoutChangeEvent, Text } from "react-native";
  5. export default function DemoA() {
  6. useEffect(() => {
  7. }, [])
  8. const years = [0, 1, 2, 3, 4, 5]
  9. const months = [0, 1, 2, 3, 4, 5]
  10. const days = [0, 1, 2, 3, 4, 5]
  11. return (
  12. <View style={{ backgroundColor: 'white', height: 800, width: 375 }} >
  13. <Text style={{ color: 'red', fontSize: 50 }}>hello world</Text>
  14. <PickerView title="hhhh" itemStyle={{ color: '#000', fonSize: 10 }} indicatorStyle='height: 50px;' style='width: 100%; height: 300px;color:white' value={[0, 1, 2, 3, 4]} onChange={(e) => { }}>
  15. <PickerViewColumn style={{ color: '#fff' }}>
  16. {years.map(item => {
  17. return (
  18. <View style={{ color: 'white', opacity: 0, backgroundColor: 'pink' }}>{item}年</View>
  19. );
  20. })}
  21. </PickerViewColumn>
  22. <PickerViewColumn>
  23. {months.map(item => {
  24. return (
  25. <View>{item}月12日</View>
  26. )
  27. })}
  28. </PickerViewColumn>
  29. <PickerViewColumn>
  30. {days.map(item => {
  31. return (
  32. <View>{item}日</View>
  33. )
  34. })}
  35. </PickerViewColumn>
  36. </PickerView>
  37. <GradientText style={{fontSize:20}}>Hello world</GradientText>
  38. </View>
  39. );
  40. }