PushAsync is not supported globally on iOS, please use a NavigationPage

前端 未结 4 1100
天命终不由人
天命终不由人 2021-01-05 03:47

Everything is working fine when I am handling the Tap event of a ListView item, but when I use this in a TabbedPage it shows the exception please p

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-05 04:11

    You should put your TabbedPage child page into NavigationPage. The following is code snippets from Xamarin documentation.

    In Xaml:

    
        
        
            
                
            
        
    
    

    Or In Code:

    public class MainPageCS : TabbedPage
    {
        public MainPageCS ()
        {
            var navigationPage = new NavigationPage (new SchedulePageCS ());
            navigationPage.Icon = "schedule.png";
            navigationPage.Title = "Schedule";
    
            Children.Add (new TodayPageCS ());
            Children.Add (navigationPage);
        }
    }
    

提交回复
热议问题