あなたは簡単に相対レイアウト(Xamarinドキュメントにおける相対的なレイアウトのために学ぶためにhereをクリックする)とあなたの要求を達成することができます:背景ページの色が白でデフォルトで
<?xml version="1.0" encoding="utf-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="YourNamesapce.YourPage">
<RelativeLayout>
<Image
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent,
Property=Width,Factor=1}"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent,
Property=Height,Factor=0.5}"
Source="icon.png"
Aspect="AspectFill"/>
<Grid
RelativeLayout.WidthConstraint="{ConstraintExpression
Type=RelativeToParent,Property=Width,Factor=1}"
RelativeLayout.HeightConstraint="{ConstraintExpression
Type=RelativeToParent,Property=Height,Factor=1}">
<!-- Your Grid Layout-->
</Grid>
</RelativeLayout>
ので、この意志それ以外の場合は、ページの背景色属性を目的の属性に設定します。
2行のグリッドを作成し、最初の行のBGにイメージを配置します。次に、他のコントロールを格納するために、各行に別のネストされたグリッドを追加します。 – Jason
@Jasonは応答してくれてありがとう!グリッドに背景イメージを追加すると、それらの白いパディングがあります。私がPaddingsを取り除くことができる唯一の方法は、ContentPageに背景イメージを追加することです。 ContentPage - > Image =パディングなし、半分/半分の背景なし。 ContentPage - >グリッド - >イメージ=半分/半分の背景がパディングです。 – TRDrake
グリッド上のパディングを変更してページ全体を埋めるようにする必要があります – Jason