locked
shell on back button handeling RRS feed

  • Question

  • User394276 posted

    Hello everyone, and thank you for the support

    As I am building my app, i am facing a two issues that I do not now how to resolve.

    My app currently have a spash, login, register and home. I need the home to be a shell (Becouse I need to put tab, hamburger menu and CarouselView)

    I tried to look in google to implement hamburger, CarouselView and tab without using shell and its impossible, so I have this errors

    1. If I put that my home screen inherit from shell, I cannot override the back button press on Android

    I also tried to inherit from MasterDetailPage and the problems persist

    1. If I implement shell, my view model start complaining, becouse apparently I need to convert something

    So I was thinking if there is a way to implement all of this (hamburger, tabs, carouselView) on a plain simple contentview

    Thanks again for all the help

    Monday, June 15, 2020 3:45 AM

Answers

  • User382871 posted

    If I put that my home screen inherit from shell, I cannot override the back button press on Android Please check if you used Shell instead of ContentPage in the HomeScreen.xaml, the OnBackButtonPressed works well in the custom shell class on my side. The code should be like below: <Shell xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" ... x:Class="App19F_5.MyPage"> ... </Shell>

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, June 15, 2020 7:50 AM

All replies

  • User382871 posted

    If I put that my home screen inherit from shell, I cannot override the back button press on Android Please check if you used Shell instead of ContentPage in the HomeScreen.xaml, the OnBackButtonPressed works well in the custom shell class on my side. The code should be like below: <Shell xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" ... x:Class="App19F_5.MyPage"> ... </Shell>

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, June 15, 2020 7:50 AM
  • User394276 posted

    thank you

    Is it posible to add a carouselView on the meddle of the shell?

    There is a way to add the shell resourcess on the app.xaml?

    I was looking about how to change the color of my navigation page and nothing

    ```