2017-04-12 70 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>