import React, { useRef } from 'react'; import { View, Text, TouchableOpacity } from 'react-native'; import { Popover, Button, Space, PopoverInstance } from '@xrnjs/ui'; import { IconMACancellation1 } from '../../../icons'; import Card from '_global/Card'; import styles from './style'; const CloseControlUsage: React.FC = () => { const manualPopoverRef = useRef(null); const handleSelect = (value: any, index?: number) => { console.log(`选择了第 ${index} 个选项:`, value); }; const closeManualPopover = () => { manualPopoverRef.current?.hide(); }; const showManualPopover = () => { manualPopoverRef.current?.show(); }; return ( 可以控制点击遮罩层、点击内容区域是否关闭气泡,也支持手动控制 } onSelect={handleSelect} statusBarTranslucent={false} > 只能手动关闭 , ]} ref={manualPopoverRef} statusBarTranslucent={false} > ); }; export default CloseControlUsage;