2 回答

TA貢獻1828條經驗 獲得超3個贊
內容頁只能有一個直接子項,因此您的 xaml 代碼應如下所示:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:SAT"
x:Class="SAT.MainPage">
<StackLayout VerticalOptions="Center"
BackgroundColor="#3C3838">
<Button Text="On\\Off"
BackgroundColor="#6FD761"
Margin="70,240,70,0"
x:Name="ToggleRelay1"
Clicked="ToggleRelay1_Clicked"/>
<Button Text="On\\Off"
BackgroundColor="#6FD761"
Margin="70,20,70,0"
x:Name="TggleRelay2"
Clicked="TggleRelay2_Clicked"/>
<Button Text="Having Trouble ? connect Manualy"
BackgroundColor="#00D06262"
Margin="0,250,0,0"/>
<WebView x:Name="TestWebView"
HeightRequest="100"
WidthRequest="100"/>
</StackLayout>
</ContentPage>

TA貢獻1829條經驗 獲得超9個贊
內容頁不支持多個項目??紤]將 Web 視圖放入 StackLayout 中,或者(如果需要按鈕來覆蓋 Web 視圖)使用 AbsoluteLayout。
- 2 回答
- 0 關注
- 123 瀏覽
添加回答
舉報