Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

I want to show different views when i tap 4 different buttons but not tabbed page.

vinothswamivinothswami Member ✭✭✭

I want to show 4 different views based on the 4 buttons says (Details, Analysis, Records, and Results) in a single page.

Tabbed page and tabbed view are not the best. becoz they occupied a row space full but I want to show as an icon.

any suggestions please.

Best Answer

Answers

  • vinothswamivinothswami Member ✭✭✭

    @rickavdijk yes its a good option for menus but I need 4 buttons as a horizontal pattern in stack layout when user tap any button different views should show on the same page, not on a different page.

  • rickavdijkrickavdijk Member ✭✭

    Do you use MVVM?

  • JarvanJarvan Member, Xamarin Team Xamurai
    edited August 2019

    I need 4 buttons as a horizontal pattern in stack layout when user tap any button different views should show on the same page

    To show different views in a page, try to use ContentView. Change the views's visibility when clicking the corresponding buttons.

  • JohnHardmanJohnHardman GBUniversity admin

    @vinothswami

    As @Jarvan said, use ContentView.

    You can either have four ContentViews and toggle visibility as required so that only one is visible at a time, or you can have just one ContentView and you change the Content of it. There are advantages and disadvantages to each approach, but ContentView is the way to go.

  • vinothswamivinothswami Member ✭✭✭

    @Jarvan & @JohnHardman , yes I thought of using the content view but is that correct way to implement?

    because each view has to save the data.. and how can I handle while the user minimizes and maximizes the App?

  • vinothswamivinothswami Member ✭✭✭

    @JohnHardman Thanks a lot..!!! it's working what I expected.

Sign In or Register to comment.