2017-03-27 13 views
0

問題

は、これは私のメインのペインのレイアウトで使用して:レイアウトは常に一貫であるように私は、私のすべてのページを読み込むところ問題フレーム

<Page 
    x:Class="Communities.MainPage" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:local="using:Communities" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" Loaded="Page_Loaded" DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}"> 

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> 
     <Grid.RowDefinitions> 
      <RowDefinition Height="48" /> 
      <RowDefinition Height="*" /> 
      <RowDefinition Height="auto" /> 
     </Grid.RowDefinitions> 
     ... 
     <SplitView Grid.Row="1" Name="hamburgerMenu" OpenPaneLength="200" PaneBackground="#F02A2A2A"> 
      <SplitView.Pane> 
       <ListView ItemsSource="{Binding}" IsItemClickEnabled="True" ItemClick="HamburgerItemClick"> 
...    </ListView> 
      </SplitView.Pane> 
      <Frame Name="frame" /> 
     </SplitView> 
     <Grid Grid.RowSpan="3" Name="popupArea" /> 
    </Grid> 
</Page> 

frameです。

さて、私の子ページのほとんどで、私はAppBar制御を定義していると、その子ページのBottomAppBarプロパティにそれを添付:

PostView.xaml

... 
<Page.BottomAppBar> 
    <CommandBar> 
     <AppBarButton Label="Back" Icon="Back" Click="TryGoBack" /> 
     <AppBarButton Label="Refresh" Icon="Refresh" Click="TryRefreshComments" /> 
     <AppBarButton Label="Go to Community" Icon="Go" Click="TryOpenCommunity" /> 
    </CommandBar> 
</Page.BottomAppBar> 
... 

ここどこですトラブルが始まります。レイアウトはデスクトップ上ではほとんど静的なので、PC上でうまく動作します。 Screenshots

私の考え

それはあらゆる種類の問題を引き起こしている子ページを表示するために使用されるフレームのように思える:それはより問題だ携帯で時間などのほとんどを必要と何のソフトウェアキーボードがありません。 AppBarがメインページで定義されると、AppBarは正しく配置されます。

私は、テキストボックスとAppBarをカバーするキーボードを避けたいと思いますが、私はframeコントロールを取り除きたくありません。私はまた、キーボードが表示されたときに、ページが上に押し出されるのではなく、「押しつぶされた」場合は好きですが、MainPageのデフォルトレベルではなく、キーボードをframeレベルで表示する方法がわかりません。

この状況を解決するにはどうすればよいでしょうか?

乾杯!

答えて

0

ご存じのように、Page.BottomAppBarをページのルートに設定すると、タッチキーボードに問題はありません。 Page.BottomAppBarを追加するのが最善の方法だと思われます。

Page.BottomAppBarを別のページのFrameに追加する場合は、UIをカスタマイズする必要があります。 UWPは、InputPaneオブジェクトによって公開されるShowingおよびHidingイベントを処理することによって、タッチキーボードの外観に同様の動作を提供します。

InputPaneVisibilityEventArgs.OccludedRectを使用すると、入力ウィンドウがカバーしているアプリケーションウィンドウの領域を取得できます。例えば

public PostView() 
{ 
    this.InitializeComponent(); 
    InputPane.GetForCurrentView().Showing += PostView_Showing; 
    InputPane.GetForCurrentView().Hiding += PostView_Hiding; 
} 

private void PostView_Hiding(InputPane sender, InputPaneVisibilityEventArgs args) 
{ 
    MyTextBox.Margin = new Thickness(0, args.OccludedRect.Height, 0, 0); 
} 

private void PostView_Showing(InputPane sender, InputPaneVisibilityEventArgs args) 
{ 
    MyTextBox.Margin = new Thickness(0, 0, 0, args.OccludedRect.Height); 
} 
関連する問題