android - 未为孩子设置 StackLayout 高度
问题描述
我在 StackLayout 中添加了标签。我为 StackLayout 设置了 HeightRequest,为 Label 设置了长文本。
我想裁剪标签中的超出文本。但它会在 StackLayout 之外呈现。怎么限制。
我不想为标签设置 HeightRequest。
<StackLayout Margin="10" HeightRequest="42" BackgroundColor="Yellow">
<Label VerticalOptions="Center" Text="A minimum 5 characters password contains a combination of uppercase and lowercase letter and number are required. A minimum 5 characters password contains a combination of uppercase and lowercase letter and number are required."/>
</StackLayout>
解决方案
为了根据上面代码中的 StackLayout 设置标签高度,请设置Orientation="Horizontal"
for stackLayout。
推荐阅读
- c - 为什么我得到错误的二进制模式?
- bash - 在 bash 中提取较大数量的文件夹名称
- reactjs - 除了 Spotify 登录重定向路径“在服务器上找不到”之外,生产 React 应用程序正常运行
- sikuli - 为什么这个脚本中没有执行 type() 函数?
- jenkins - nuget.exe push 引发错误。底层连接被关闭:连接被意外关闭
- django - 如何将数据从视图发送到标题或导航栏
- javascript - Vuejs 多种样式绑定?
- angular - Angular - 使用多个 http 请求测试异步功能
- scala - 在 Databricks(Scala)中读取文本文件时无法解析类型为 \u0003 的分隔符
- javascript - 如何在 php 中处理来自 ajax 的数组