Hi,
I have a simple MasterDetailPage:
public class ArticlesPage : MasterDetailPage
{
private readonly IViewLocator _viewLocator;
public ArticlesPage(IViewLocator viewLocator)
{
_viewLocator = viewLocator;
CreateUI();
}
// ReSharper disable InconsistentNaming
private void CreateUI()
// ReSharper restore InconsistentNaming
{
Master = CreateMaster();
Detail = CreateDetail();
}
private ArticleDetailPage CreateDetail()
{
return _viewLocator.ArticleDetailPage;
}
private ArticleMasterPage CreateMaster()
{
return _viewLocator.ArticleMasterPage;
}
protected override void OnAppearing()
{
IsPresented = true;
}
}
On Android and iOS the MasterPage does not occupy all horizontal space it could have.
I use the following for startup:
// Android
SetPage(ViewLocator.Instance.ArticlesPage);
If I start directly with the ArticleMasterPage it uses all the space as I should. If used as shown, it does not.
All components and containers have HorizontalOption = LayoutOptions.FillAndExpand
.
I'm wondering, why it does not work with the MasterDetailPage.
I tried setting WidthRequest
to different numbers, but nothing changes.
Anyone can confirm this?
I'm using latest Xamarin.Forms Prerelease 2