2017-04-12 33 views
0

想知道是否有其他人遇到以下問題。ListView ContextAction不遵循佈局

我有我的App.MainPage裹在導航頁面

MainPage = new NavigationPage(new MyPage()); 

MyPage我瀏覽到一個用戶帳戶頁面這是一個TabbedPage

await Navigation.PushAsync(new MyAccountTabbedPage()); 

和這裏的XAML(很簡單)

<TabbedPage.Children> 
    <userAccount:SitesTab /> 
    <userAccount:ProjectsTab /> 
    <userAccount:SettingsTab /> 
</TabbedPage.Children> 

現在,這裏是它得到的地方很有趣。從我SitesTab內,我需要出示ListView包含ContextActions

<AbsoluteLayout> 
    <ListView AbsoluteLayout.LayoutBounds="0,0,1,1" 
       AbsoluteLayout.LayoutFlags="All" 
       ItemsSource="{Binding ListItems}"> 
     <ListView.ItemTemplate> 
      <DataTemplate> 
       <ViewCell> 
        <ViewCell.ContextActions> 
         <MenuItem Text="Do Stuff"/> 
         <MenuItem Text="Delete Stuff" IsDestructive="True"/> 
        </ViewCell.ContextActions> 
        <StackLayout> 
         <Label Text="{Binding .}"/> 
        </StackLayout> 
       </ViewCell> 
      </DataTemplate> 
     </ListView.ItemTemplate> 
    </ListView> 
</AbsoluteLayout> 

我對跑起來的問題是,在Android上下文操作不會覆蓋/更換導航欄,而是把它推並擰緊一切。

語境

前背景信息

那麼什麼是在這裏嗎?有沒有人想出瞭解決這個問題的方法?頁面頂部的上下文菜單應該覆蓋NavigationBar,而不是將所有內容都推下。

+0

你能告訴哪個版本是你xamarin.forms以下?我目前正在一個擁有Xamarin.Forms 2.3.3.193的項目中工作,它將覆蓋像[this]這樣的導航欄(https://i.stack.imgur.com/B0hqT.png)。 –

+0

是的,我在同一個版本 –

回答

0

原來我需要在我的應用程序兼容性主題

<style name="myActivityTheme" parent="Theme.AppCompat.NoActionBar"> 
    <item name="windowActionModeOverlay">true</item> 
</style>