import React from 'react';
import { View, Text } from 'react-native';
import { Popover, Button, Space, Size } from '@xrnjs/ui';
import Card from '_global/Card';
import styles from './style';
const CustomContentUsage: React.FC = () => {
const handleSelect = (value: any, index?: number) => {
console.log(`选择了第 ${index} 个选项:`, value);
};
const customContent = (
自定义内容区域
可以放置任意的 React 组件
);
const renderCustomContent = (
nodes: React.ReactNode,
closePopover: () => void
) => {
return (
自定义渲染器
{nodes}
);
};
return (
支持自定义内容和自定义渲染器,可以实现复杂的交互效果
项目一
,
项目二
,
]}
renderContentComponent={renderCustomContent}
onSelect={handleSelect}
statusBarTranslucent={false}
>
带分割线的项目
,
禁用的项目
,
]}
onSelect={handleSelect}
statusBarTranslucent={false}
>
);
};
export default CustomContentUsage;