如何在列表图标中添加弹出列表菜单?
请帮助我了解如何添加流行菜单列表,例如我附加的图片。我很知道本地人反应。请帮助我。以下是代码。我想在成员列表页面中添加流行菜单列表。顺便说一下,我从headerbar.js导入了图标。 pop菜单列表的附加图像
memberlist.js
import React from 'react';
import { HeaderBar4 } from '../components/HeaderBar';
import {GrayScrollView, EventTitle,SearchBarAlign} from '../components/styles';
import { MemberCell, SearchBarCell } from '../components/MemberInput';
const MemberList = ({navigation}) => {
return (
<GrayScrollView contentContainerStyle={{justifyContent: 'center'}}>
<HeaderBar4/>
<EventTitle>Members List</EventTitle>
<SearchBarAlign>
<SearchBarCell/>
</SearchBarAlign>
<MemberCell/>
</GrayScrollView>
);
}
export default MemberList;
headerbar.js
export const HeaderBar4 = () => {
const navigation = useNavigation();
return (
<HeaderBarContainer>
<LeftBarContainer>
<TouchableOpacity activeOpacity={0.6} onPress={() => navigation.goBack()}>
<BackIcon name="arrow-left"/>
</TouchableOpacity>
</LeftBarContainer>
<RightBarContainer>
<TouchableOpacity activeOpacity={0.6} onPress={undefined}>
<CartIcon name="cart-outline" />
</TouchableOpacity>
<TouchableOpacity activeOpacity={0.6} onPress={undefined}>
<BellIcon name="bell" />
</TouchableOpacity>
<TouchableOpacity activeOpacity={0.6} onPress={undefined}>
<SliderIcon name="list"/>
</TouchableOpacity>
</RightBarContainer>
</HeaderBarContainer>
);
}
Please help me out on how to add pop menu list like the picture I attached. I'm quite knew to react native. Please help me out. Below are the codes. I would like to add the pop menu list in member list page. By the way i have imported the icon from headerbar.js.
Attached Image Of Pop menu list
MemberList.js
import React from 'react';
import { HeaderBar4 } from '../components/HeaderBar';
import {GrayScrollView, EventTitle,SearchBarAlign} from '../components/styles';
import { MemberCell, SearchBarCell } from '../components/MemberInput';
const MemberList = ({navigation}) => {
return (
<GrayScrollView contentContainerStyle={{justifyContent: 'center'}}>
<HeaderBar4/>
<EventTitle>Members List</EventTitle>
<SearchBarAlign>
<SearchBarCell/>
</SearchBarAlign>
<MemberCell/>
</GrayScrollView>
);
}
export default MemberList;
HeaderBar.js
export const HeaderBar4 = () => {
const navigation = useNavigation();
return (
<HeaderBarContainer>
<LeftBarContainer>
<TouchableOpacity activeOpacity={0.6} onPress={() => navigation.goBack()}>
<BackIcon name="arrow-left"/>
</TouchableOpacity>
</LeftBarContainer>
<RightBarContainer>
<TouchableOpacity activeOpacity={0.6} onPress={undefined}>
<CartIcon name="cart-outline" />
</TouchableOpacity>
<TouchableOpacity activeOpacity={0.6} onPress={undefined}>
<BellIcon name="bell" />
</TouchableOpacity>
<TouchableOpacity activeOpacity={0.6} onPress={undefined}>
<SliderIcon name="list"/>
</TouchableOpacity>
</RightBarContainer>
</HeaderBarContainer>
);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不是100%,如果您想制作弹出菜单,我会得到您的问题://github.com/instea/reaeact-native-popup-menu“ rel =“ nofollow noreferrer”>弹出菜单包。如果您有兴趣制作自己的组件,则可以遵循本文链接到自定义弹出菜单文章
如果您想制作圆形复选框,则可以使用此软件包。 链接到圆形复选框软件包。
I am not 100% I get your question if you are trying to make a pop-up menu you will need to work with the z-index of your component styles or you can use pre-made packages like this Pop up menu package. If you are interested in making your own component you can follow this article Link to custom pop up menu article
If you are trying to make circular checkboxes you can use this package. Link to circular checkbox package.