gpt4 book ai didi

ios - 图层边界未显示在 View 和 UITableView 的顶部和右边缘

转载 作者:行者123 更新时间:2023-11-29 12:48:55 24 4
gpt4 key购买 nike

我使用以下代码为 UIView 添加边框,并为 UITableView 添加边框。

UIView:

RectangleF _frame = new RectangleF (0, 0, this.Frame.Width , 56);
DescriptionView = new UIView (_frame);
DescriptionView.BackgroundColor = UIColor.White ;
DescriptionView.Layer.BorderColor = new CGColor (0, 0, 0, 1.0f);
DescriptionView.Layer.BorderWidth = 0.5f;

对于 UITable:

RectangleF _frame = new RectangleF (0, DescriptionView.Frame.Height + 10,
this.Frame.Width , this.Frame.Height - (DescriptionView.Frame.Height + 10));
InstructionTable = new UITableView (_frame);
InstructionTable.Layer.BorderColor = new CGColor (0, 0, 0, 1.0f);
InstructionTable.Layer.BorderWidth = 0.5f;

对于 iPhone 3.5 英寸和 iPhone 4 英寸,它工作正常,但对于 iPad,边框未显示在 View 右侧以及表格的顶部和右侧。请参见下面的屏幕截图:

enter image description here

最佳答案

代替:

DescriptionView.Layer.BorderWidth = 0.5f;

我使用了刨丝器的宽度:

DescriptionView.Layer.BorderWidth = 1f;

它解决了我的问题

关于ios - 图层边界未显示在 View 和 UITableView 的顶部和右边缘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22908814/

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