是的,设计失败并且没有选项定制。对于此类问题,我更喜欢Grid。您可以使用带有百分比的列或行。
默认位置。
<Shell.TitleView>
<Grid>
<ffimageloadingsvg:SvgCachedImage
Source="https://stackoverflow.design/assets/img/logos/so/logo-stackoverflow.svg"
Margin="10"/>
</Grid>
</Shell.TitleView>
![默认视图](https://i.stack.imgur.com/YxB2h.png)
在此示例中,第一列为 4/5 单位,第二列为 1/5 单位(* 符号表示百分比或除数)。
<Shell.TitleView>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<BoxView BackgroundColor="Yellow"/>
<BoxView Grid.Column="1" BackgroundColor="LightGoldenrodYellow"/>
</Grid>
</Shell.TitleView>
![示例布局](https://i.stack.imgur.com/V7zTZ.png)
然后将图像文本或控件添加到首选布局(图像控件默认列是 0)。
<Shell.TitleView>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<ffimageloadingsvg:SvgCachedImage
Source="https://stackoverflow.design/assets/img/logos/so/logo-stackoverflow.svg"
Margin="10"/>
</Grid>
</Shell.TitleView>
![结果视图](https://i.stack.imgur.com/HMumF.png)
编辑:将最小高度添加到网格或图像控件以防止调整内容大小。ffimageloadingsvg也是用于加载 svg 文件的第三方包。