2017-01-10 3 views
0

こんにちは私はxamarinを使ってクロスプラットフォームアプリケーションを開発し始めましたが、私はwinphoneプロジェクトで非常に早い段階で問題にぶつかりました。xamarin.forms複数のナビゲーションページを持つwinphoneのタブページタイトル

私は2つのナビゲーションページを含むタブ付きページを持っています。これらのナビゲーションページはどちらも同じコンテンツを持っていますが、唯一違うのはそれぞれのタイトルです。問題は、タブ付きページをスワイプするときに発生します。最初にロードされたときは正しくレンダリングされますが、一旦タブを囲むとタイトルが失われてしまい、もう1つはページの上部に飛びます。場所タブページが上手くレンダリングされます。

When app is opened

After viewing the Location tab

MainPage.xamlを

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" 
     xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
     xmlns:local="clr-namespace:iLarm;assembly=iLarm" 
     x:Class="iLarm.MainPage"> 
<NavigationPage Title="Alarm"> 
    <x:Arguments> 
     <local:AlarmListPage /> 
    </x:Arguments> 
    </NavigationPage> 
    <NavigationPage Title="Location" > 
    <x:Arguments> 
     <local:LocationListPage /> 
    </x:Arguments> 
    </NavigationPage> 
</TabbedPage> 

AlarmListPage.xaml

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
     xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
     x:Class="iLarm.AlarmListPage" 
     Title="iLarm"> 
</ContentPage> 

locationListPage.xaml

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
     xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
     x:Class="iLarm.LocationListPage" 
     Title="iLarm"> 
</ContentPage> 
+0

この問題を再現できるコードを投稿したり、デモを共有したりできますか?そして空の空のアプリでこの問題を解決してみてください。 –

+0

こんにちはNico xamlコードが追加されました。これは基本的に空のアプリです。私はVisual Studioを介して空のXamarin.formsアプリを作成してから、tabbedPage、NavigationPages、およびコンテンツページを追加しました。 – Charlie

答えて

0

あなたのコードに従って、私はデモを書いた。しかし、ContentPageのタイトルは全く表示されませんでした。

あなたのスクリーンショットから、TabbedPageの上にタイトルを追加するとします。この要件によるとTabbedPageTitleを以下のように設定する必要があります。

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" 
     xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
     xmlns:local="clr-namespace:iLarm;assembly=iLarm" 
     x:Class="iLarm.MainPage" 
     Title="iLarm"> 
    <NavigationPage Title="Alarm"> 
     <x:Arguments> 
      <local:AlarmListPage /> 
     </x:Arguments> 
    </NavigationPage> 

    <NavigationPage Title="Location"> 
     <x:Arguments> 
      <local:LocationListPage /> 
     </x:Arguments> 
    </NavigationPage> 
</TabbedPage> 
+0

こんにちは、あなたの助けていただきありがとうございますが、私はそれと同じ結果を試みました。私はそれがXamarin.Formsの問題かもしれないと思っています。私はタイトルとかなりのバリエーションを試してみましたが、すべて同じ結果を出すようです。 – Charlie

+0

@Charlie、新しいプロジェクトを試してみましたか?あなたのxamarin.formsのバージョンは何ですか? –

関連する問題