【发布时间】:2021-12-31 15:34:29
【问题描述】:
我正在尝试在我的 react 本机导航抽屉中创建一个自定义抽屉,我试图在其中放置图标和按钮而不是抽屉屏幕组件。我的一些代码放在这里供参考:
function CustomDrawerContent(props: DrawerContentComponentProps) {
<DrawerContentScrollView {...props} >
<DrawerItemList {...props} />
<DrawerItem
label="Facebook"
onPress={() => Linking.openURL('https://www.facebook.com/mysite/')}
inactiveTintColor="black"
/>
<DrawerItem
label="Instagram Page"
onPress={() => Linking.openURL('https://www.instagram.com/mysite/')}
inactiveTintColor="black"
/>
</DrawerContentScrollView>
我正在尝试将这些抽屉项目作为我网站的 Facebook 和 Instagram 页面的按钮/图标,用户将被定向到这些页面。我可以知道如何实现这一目标吗?
【问题讨论】:
标签: react-native navigation-drawer react-native-navigation