【问题标题】:Layer boarder not showing at top and right edge of view and UITableView图层边框未显示在视图和 UITableView 的顶部和右侧边缘
【发布时间】:2014-05-19 11:35:59
【问题描述】:

我使用以下代码为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,边框没有显示在视图的右侧以及表格的顶部和右侧。请参见下面的屏幕截图:

【问题讨论】:

  • 以前有人见过这个问题吗?

标签: ios uitableview uiview ios7 xamarin.ios


【解决方案1】:

代替:

DescriptionView.Layer.BorderWidth = 0.5f;

我用的是更粗的宽度:

DescriptionView.Layer.BorderWidth = 1f;

它解决了我的问题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多