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 关注
- 130 浏览
添加回答
举报