Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

StackLayout not adaptive after navigate back and forth between pages

$
0
0

Hi guys,
I quite new to Xamarin and sorry for bad english. Basically, I got two page one is Mainpage and another is Page1 to learn about navigation and responsive of the app when device is portrait or landscape. So here is Xaml on Mainpage:

`

<StackLayout>

    <Label Text="Welcome to Xamarin!" 
       VerticalOptions="Fill" />

    <Button Text="Click me" Clicked="clickhandler"></Button>

</StackLayout>  `

And here is the code-behind
public async void clickhandler(object sender, EventArgs args) { await Navigation.PushAsync(new Page1(), true); }

My issue is that when the app run at the first time, it adapt well with the portrait or landscape screen. But after i navigated to another page(click the button) and come back. The app not adapt with the screen size any more :(. I myself knew that the HorizontalOptions and VerticalOptions was set to Fill by default so that it should adapt well when we change the screen size but it was not.
I try many way such as changed the value of HorizontalOptions and VerticalOptions, also check out the device orientation article on xamarin document site
with no luck.

Could you please help me for this issue,

Many thanks.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>