2017-02-27 132 views
-1

我有两个UIViews与拐角半径重叠。他们有相同的颜色。我试图找出,如何防止拐角半径做出一个稍微黑暗的“边框中风”有谁知道如何防止这种情况?移除拐角半径处的阴影/边界线iOS

var topHistoryLine : UIView 
var bottomHistoryLine :UIView 

    topHistoryLine.layer.clipsToBounds = topHistoryLine.bounds.width/2 
    topHistoryLine.clipsToBounds = true 
    bottomHistoryLine.layer.cornerRadius = bottomHistoryLine.bounds.width/2 
    bottomHistoryLine.clipsToBounds = true 
    topHistoryLine.layer.shadowOpacity = 0.0 
    bottomHistoryLine.layer.shadowOpacity = 0.0 

Example

+2

添加代码。图像根本不清楚。 – hasan83

+0

添加代码;)。图像放大很多,使较暗的线条可见。这是一个非常小的细节,几乎不可能看到。 –

回答

0
View.layer.shadowOpacity = 0.0 
View.layer.shadowRadius = 0.0 
View.layer.shadowColor = UIColor.clear 
+0

不起作用... :( –

+0

尝试更新回答 –

+0

它接缝不像它的阴影偏好,但视图本身,调整颜色,使曲线看起来更好。 –