Xamarin формирует masterdetailspage со списком - PullRequest
0 голосов
/ 03 августа 2020

У меня странная графическая проблема с использованием страницы masterdetailspage форм xamarin со списком.

Я заявляю, что эта проблема не возникает в эмуляторе.

Я прикрепляю видео.

https://imgur.com/a/CKzh9ku

<ScrollView>
                <ListView x:Name="menuRouteView"
                          Margin="{d:OnPlatform Android='0',iOS='0,40,0,0'}"
                          ItemTapped="menuRouteView_ItemTapped">
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <ViewCell>
                                <StackLayout Orientation = "Horizontal" Margin = "5">
                                     <Image  Source = "{Binding icon}"/>
                                    <Label FontSize="Medium" Text = "{Binding name}" Margin = "5"/>
                                </StackLayout>
                            </ViewCell>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
        </ScrollView>

     public MasterPage()
        {
            InitializeComponent();

            /**
             * Init menu dynamic
             */
            Route routeClass = new Route();
            createMenu(routeClass);
        }
 
        public void createMenu(Route routeClass)
        {
            List<Route> routeListSecondary = routeClass.getAllData();

            List<Route> routes = new List<Route>();

            if (routeListSecondary.Count() > 0)
            {
                routes.Add(new Route() { name = "Pagina utente", url = "", fullScreen = "", addUserKey = "", primary = true, icon = "ic_blue_action_home.png", to = "menu", action = "" });
                routes.Add(new Route() { name = "Email", url = "", fullScreen = "", addUserKey = "", primary = true, icon = "ic_blue_content_drafts.png", to = "email", action = "" });
                routes.Add(new Route() { name = "Calendar", url = "", fullScreen = "", addUserKey = "", primary = true, icon = "ic_blue_calendar.png", to = "agenda", action = "" });
                routes.Add(new Route() { name = "Chat", url = "", fullScreen = "", addUserKey = "", primary = true, icon = "ic_blue_communication_message.png", to = "chat", action = "" });
                routes.Add(new Route() { name = "blu d'hOC", url = "", fullScreen = "", addUserKey = "", primary = true, icon = "ic_blue_action_description.png", to = "bludhoc", action = "" });

                foreach (var item in routeListSecondary)
                {
                    routes.Add(new Route() { name = item.name, url = item.url, fullScreen = item.fullScreen, addUserKey = item.addUserKey, primary = false, icon = "iconNavigation.png", to = "", action = "" });
                }


                routes.Add(new Route() { name = "Configura", url = "", fullScreen = "", addUserKey = "", primary = true, icon = "ic_blue_action_settings.png", to = "", action = "ConfigurationPage" });
                //routes.Add(new Route() { name = "ZXingScanningPage", url = "", fullScreen = "", addUserKey = "", primary = true, icon = "ic_blue_action_settings.png", to = "", action = "ZXingScanningPage" });
                routes.Add(new Route() { name = "Documenti scaricati", url = "", fullScreen = "", addUserKey = "", primary = true, icon = "ic_blue_file_cloud_done.png", to = "", action = "DownloadDocuments" });

            }
            else
            {
                routes.Add(new Route() { name = "Workflow", url = "", fullScreen = "", addUserKey = "", primary = true, icon = "", to = "", action = "ApplicationInfo" });
                routes.Add(new Route() { name = "Chi siamo", url = "", fullScreen = "", addUserKey = "", primary = true, icon = "", to = "", action = "BusinessInfo" });

            }

            menuRouteView.ItemsSource = routes;
        }

Вот часть используемого кода, лично я не вижу ничего плохого. Большое спасибо.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...