2016-09-19 50 views
3

我使用Xamarin Studio 6.1,最近升級它與Xamarin Forms項目一起工作。我似乎無法使OnPlatform標籤正常工作。我想這樣的事情OnPlatform標籤不能在Xamarin Forms中工作

<Grid Padding="12"> 
    <Grid.HeightRequest> 
     <OnPlatform /> 
    </Grid.HeightRequest> 
</Grid> 

預覽器立即打破和投訴無效的XA​​ML:類型OnPlatform not found in xmlns="http://xamarin.com/schemas/2014/forms"

我從來沒有見過這個錯誤之前,無法找到任何在線幫助。有任何想法嗎?

回答

6

可能是因爲沒有指定TypeArgument。試試這個:

 <Grid.HeightRequest> 
     <OnPlatform x:TypeArguments="x:Double" 
     iOS="15" Android="10" 
     WinPhone="10"/> 
     </Grid.HeightRequest> 
+0

現在說'無效的XA​​ML:類型雙在xmlns' –

+0

沒有發現把'x'空間標識符'Double'像'X:Double' – Kowalski

+0

是的,對不起,是我不好。有時候我是一個小菜鳥 –

相關問題