2017-01-25 4 views
3

У меня есть второстепенная проблема в оформлении страницы мастер-детали с навигационной страницей в форме xamarin.Как отобразить содержимое меню главной страницы, которое будет отображаться под панелью навигации?

Содержание главной страницы с полной высотой устройства. Я хочу, чтобы содержимое отображалось со дна панели навигации.

Вот образец главной страницы:

<?xml version="1.0" encoding="utf-8" ?> 
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms" 
      xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
      x:Class="XamarinExp.Pages.SampleMasterPage"> 
    <MasterDetailPage.Master> 
    <ContentPage Title="Menu"> 
     <StackLayout Spacing="0"> 
     <Label Text="Sample Menu" FontSize="Large" FontAttributes="Bold"></Label> 
     <ListView x:Name="lvMenu" SeparatorColor="Green"> 
      <ListView.ItemTemplate> 
      <DataTemplate> 
       <ViewCell> 
       <StackLayout Padding="10,0,0,0"> 
        <Label HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" YAlign="Center" Text="{Binding Title}" TextColor="#03a9f4" > 
        <Label.GestureRecognizers> 
         <TapGestureRecognizer Tapped="OnLabelClicked" /> 
        </Label.GestureRecognizers> 
        </Label> 
       </StackLayout> 
       </ViewCell> 
      </DataTemplate> 
      </ListView.ItemTemplate> 
     </ListView> 
     </StackLayout> 
    </ContentPage> 
    </MasterDetailPage.Master> 
</MasterDetailPage> 

И этот фрагмент кода из файла CS:

NavigationPage nPage = new NavigationPage(new DeviceCheck()); 
this.Detail = nPage; 

И это то, что я имею в Droid/Ресурсы/значения/styles.xml

<?xml version="1.0" encoding="utf-8" ?> 
<resources> 

    <style name="MainTheme" parent="MainTheme.Base"> 
    </style> 
    <!-- Base theme applied no matter what API --> 
    <style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"> 
    <!--If you are using revision 22.1 please use just windowNoTitle. Without android:--> 
    <item name="windowNoTitle">true</item> 
    <!--We will be using the toolbar so no need to show ActionBar--> 
    <item name="windowActionBar">false</item> 
    <!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette --> 
    <!-- colorPrimary is used for the default action bar background --> 
    <item name="colorPrimary">#2196F3</item> 
    <!-- colorPrimaryDark is used for the status bar --> 
    <item name="colorPrimaryDark">#1976D2</item> 
    <!-- colorAccent is used as the default value for colorControlActivated 
     which is used to tint widgets --> 
    <item name="colorAccent">#FF4081</item> 
    <!-- You can also set colorControlNormal, colorControlActivated 
     colorControlHighlight and colorSwitchThumbNormal. --> 
    <item name="windowActionModeOverlay">true</item> 

    <item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item> 

    <item name="android:windowDrawsSystemBarBackgrounds">true</item> 
    <item name="android:statusBarColor">@android:color/transparent</item> 
    </style> 

    <style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog"> 
    <item name="colorAccent">#FF4081</item> 
    </style> 
</resources> 

Я хочу, чтобы меню начиналось снизу от синей полосы.

Любая помощь приветствуется. Заранее спасибо.

+0

вам удалось решить эту проблему? – user3841581

ответ

1

В App.cs установлен MainPage типа NavigationPage

MainPage = new NavigationPage(new SampleMasterPage());