Добавить границу в веб-представление - PullRequest
0 голосов
/ 25 сентября 2018

Я работаю над проектом Xamarin Forms с использованием Visual studio 2017, я хочу добавить рамку в веб-представление.с черным цветом.как сделать это посмотреть xaml ниже.

 <StackLayout Orientation="Vertical"  BackgroundColor="White" HorizontalOptions="FillAndExpand">
        <StackLayout Orientation="Horizontal" HeightRequest="60" HorizontalOptions="FillAndExpand" BackgroundColor="DarkBlue" Padding="5">
            <Label x:Name="lblUserNewOnBoarding" WidthRequest="340" Text="New User Onboarding" FontAttributes="Bold"  FontFamily="Roboto" FontSize="Large" TextColor="White" 
                   HorizontalOptions="StartAndExpand" VerticalOptions="CenterAndExpand"></Label>
            <Button x:Name="bntCancel"  Text="Cancel"  HeightRequest="40" BackgroundColor="#4184f3"  
                    TextColor="White"    HorizontalOptions="EndAndExpand" VerticalOptions="CenterAndExpand"  Clicked="HandleCancle_Clicked"   FontFamily="Roboto" FontSize="Small" FontAttributes="Bold">
                <Button.Image>
                    <FileImageSource File="baseline_cancel_white_18dp.png" ></FileImageSource>
                </Button.Image>
            </Button>
        </StackLayout>
        <StackLayout Orientation="Vertical" HorizontalOptions="CenterAndExpand"  >
            <Label Text="Please agree to the following terms and conditions…" FontFamily="Roboto-Medium" FontSize="30" 
                   HorizontalOptions="CenterAndExpand"  WidthRequest="927"  HeightRequest="168" Margin="5"  
                   TextColor="Black"></Label>

            <WebView x:Name="wvAgree"  HeightRequest="300"  WidthRequest="400" Margin="50" BackgroundColor="White" ></WebView>
            <Button x:Name="btnAgree"  Text="Agree"   WidthRequest="190"  HeightRequest="50"  AnchorX="417"  AnchorY="604"
                    BackgroundColor="#4184f3"   TextColor="White"    HorizontalOptions="Center" VerticalOptions="CenterAndExpand" Clicked="HandleAgree_Clicked"   FontFamily="Roboto" FontSize="Small" FontAttributes="Bold">
                <Button.Image >
                    <FileImageSource File="Agree.png"></FileImageSource>
                </Button.Image>
            </Button>
            <Button x:Name="btnDisAgree"  Text="Disagree"  WidthRequest="190"  HeightRequest="50"  AnchorX="417"  AnchorY="673" BackgroundColor="#4184f3"   
                    TextColor="White"    HorizontalOptions="Center" VerticalOptions="CenterAndExpand"  Clicked="HandleDisAgree_Clicked"   FontFamily="Roboto" FontSize="Small" FontAttributes="Bold">
                <Button.Image>
                    <FileImageSource File="baseline_delete_48.png" ></FileImageSource>
                </Button.Image>
            </Button>
        </StackLayout>
    </StackLayout>

1 Ответ

0 голосов
/ 25 сентября 2018

Оберните ваш WebView вокруг Frame.Итак:

<Frame OutlineColor="Black">
<WebView x:Name="wvAgree"  HeightRequest="300"  WidthRequest="400" Margin="50" BackgroundColor="White"/>
</Frame>

Также вам не нужно писать дополнительный закрывающий тег, если вы между ними ничего не ставите.Обратите внимание, как я закрыл этот тег WebView.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...