c# - Xamarin表单中内容扩展时如何使Frame扩展
问题描述
根据标题,我在框架内有一个标签,既设置为填充和扩展,也设置为在网格内,想知道当标签文本的内容进入下一行时是否可以自动扩展
<Frame Grid.Row="1"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand"
Margin="15,25,15,10"
CornerRadius="25"
Padding="10"
HasShadow="False"
BorderColor="Transparent"
BackgroundColor="White">
<Label x:Name="QuestionLabel"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Start"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand"
LineBreakMode="WordWrap"
Style="{x:StaticResource LabelTitleBold}"
Text="{Binding Question}"
TextColor="{x:StaticResource Primary}"/>
</Frame>
这就是我所做的,任何输入将不胜感激
谢谢
解决方案
您需要做的是尝试将 Grid 的 RowDefinition 中的 Row 高度设置为 Auto。这可能会有所帮助。
<RowDefinition Height="auto" />
让我知道
推荐阅读
- logstash - 无法重命名/复制 logstash 中的根字段名称
- flutter - 如何以正确的方式定义未来列表?
- azure-cosmosdb - EF Core 5.0 和 CosmosDB - 嵌套列表属性部分填充
- r - optim() 得到观察到的信息矩阵
- ajax - 如何使用一个触发器在多个屏幕上显示内容?
- python - 使用 utf-8 编码和解码返回 UnicodeError
- linux - 在 Linux 下为 Go Lang 编译 MuPdf
- python - 在不和谐机器人中未定义踢
- python - RGB像素的熵
- tensorrt - 使用 TensorRT 进行自定义对象检测