【问题标题】:How to set an upper border/separator line in ios?如何在 ios 中设置上边框/分隔线?
【发布时间】:2013-10-10 01:26:42
【问题描述】:

我有一个图像视图和一个标签,我想要它们之间的边框,最好的方法是什么?

我知道下面的代码在整个 imageView 周围创建了一个边框:

[imageView.layer setBorderColor: [[UIColor blackColor] CGColor]];
[imageView.layer setBorderWidth: 2.0];

但我只想要它下面的一条线,而不是整个东西。

【问题讨论】:

    标签: objective-c imageview label border line


    【解决方案1】:

    只需在UIImageViewUILabel 之间添加一个背景颜色为黑色的UILabel(假设您的边框颜色为黑色)和1px 的高度,这会简单得多。

    【讨论】:

    猜你喜欢
    • 2016-09-22
    • 1970-01-01
    • 2018-12-10
    • 2016-11-17
    • 2011-08-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多