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.

Orientation issue in xamarin android

jebaseelanthiyagarajanjebaseelanthiyagarajan USMember ✭✭
edited May 2019 in Xamarin.Forms

Problem Solvers,
I'm Stuck with the orientation issue once i placed the content views inside below structure.

Root : CarouselPage
Child : TabView
TabView Child : ContentPage
Content Page Child : ContentViews

In below a attached images Yellow Color I used for ScrollView and Green color Used for StackLayout. App works in a portrait mode. On iOS It works fine even in landscape view.

Best Answer

Answers

  • JarvanJarvan Member, Xamarin Team Xamurai
    edited May 2019

    I've written a basic sample based on the information you provided and it works well when rotating the screen. As the image shows:

    Please post the code of ContentViews. Or would you mind sharing a basic demo? It'll help to reproduce the issue and get a solution.

  • <ContentView.Content>
    
        <ScrollView>
            <StackLayout Padding="2" Margin="2,10,5,2">
                <StackLayout x:Name="ctrlStackHeader">    ----> Run Time I'm adding the Controls
    
    
                </StackLayout>
    
                <StackLayout x:Name="ctrlStackImage">
    
                </StackLayout>
    
                <StackLayout x:Name="ctrlStackData">
    
                </StackLayout>
    
                <StackLayout>
                    <Button x:Name="ctrlBtnProceed" Text="Proceed" Clicked="Proceed"/>
                </StackLayout>
                <StackLayout>
                    <Button x:Name="ctrlBtnReset" Text="Clear" Clicked="ClearValues"/>
                </StackLayout>
            </StackLayout>
    
        </ScrollView>
    
    </ContentView.Content>
    

  • JarvanJarvan Member, Xamarin Team Xamurai
    edited May 2019


    What's the TabView? A plugin? I use Xam.Plugin.TabView to deploy the code and it works well.

    view.xaml.cs

    public View1()
    {
        InitializeComponent();
        ctrlStackHeader.Children.Add(new Label { Text = "ctrlStackHeader" });
        ctrlStackImage.Children.Add(new Image { Source = "grid_" });
        ctrlStackData.Children.Add(new ListView
        {
            ItemsSource = new List<string>
                { "mono","monodroid","monotouch","monorail","monodevelop",
                "monotone","monopoly","monomodal","mononucleosis",
                }
        });
    }
    

  • i tried again, sill same issue exists.

  • JarvanJarvan Member, Xamarin Team Xamurai

    Would you mind sharing a basic demo?

  • yes I will share the basic demo

  • hi this is the sample demo app. i posted it in the git hub public repository. kindly give solution for my problem. Thanks in advance.
    https://github.com/jebaseelan10/TabView.git

  • Hi Friend, We are really happy about your effort on fixing our issue. Thanks for this Great Solution. It is Greatly helping in our development process.

Sign In or Register to comment.