如何在列表图标中添加弹出列表菜单?

发布于 2025-01-30 20:28:32 字数 2029 浏览 5 评论 0原文

请帮助我了解如何添加流行菜单列表,例如我附加的图片。我很知道本地人反应。请帮助我。以下是代码。我想在成员列表页面中添加流行菜单列表。顺便说一下,我从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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

儭儭莪哋寶赑 2025-02-06 20:28:32

我不是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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文