gpt4 book ai didi

xamarin - Xamarin.Forms 中的分隔符

转载 作者:行者123 更新时间:2023-12-03 08:17:01 26 4
gpt4 key购买 nike

我想用 水平分隔符 表格中的线条。据我发现, Xamarin.Forms 不提供一个。

有人可以提供分隔符的片段吗?

更新 1

根据杰森的提议,这看起来不错:

// draws a separator line and space of 5 above and below the separator    
new BoxView() { Color = Color.White, HeightRequest = 5 },
new BoxView() { Color = Color.Gray, HeightRequest = 1, Opacity = 0.5 },
new BoxView() { Color = Color.White, HeightRequest = 5 },

呈现以下分隔线:

enter image description here

最佳答案

您可以尝试使用 BoxView

// sl is a StackLayout
sl.Children.Add(new BoxView() { Color = Color.Black, WidthRequest = 100, HeightRequest = 2 });

尽管在我的测试中,没有遵循宽度请求。这可能是一个错误,或者其他设置可能会干扰它。

关于xamarin - Xamarin.Forms 中的分隔符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24102110/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com