동일한 문제가 발생했습니다. 직접적으로 나는 그것을 할 수 없다. 그래서 나는 아래에서 약간의 까다로운 논리를 사용했고 나를 위해 일했다. 힌트를 드리겠습니다.이 논리가 도움이되기를 바랍니다.
내가 밑줄 버튼 내가 그것을 제거 할 필요가 일부 일치하는 경우에, 그래서 방법을의 drawRect 사용하여 그려, 그래서 나는 다음과 같이 수행
참고 : "isRemoveUnderLine은"내 사용자 정의 버튼 클래스에서 부울 속성입니다
if ([array count] == 2) {
myButton.isRemoveUnderLine = YES;
[myButton setNeedsDisplay]; //it will update your button context and call drawRect method again...
}
// 코드 아래의 drawRect 방법 :
- (void)drawRect:(CGRect)rect {
[super drawRect:rect];
CGContextRef context = UIGraphicsGetCurrentContext();
if(_isRemoveUnderLine)
CGContextSetStrokeColorWithColor(context, [UIColor clearColor].CGColor);
else
CGContextSetStrokeColorWithColor(context, self.currentTitleColor.CGColor);
...
...
}
당신이 당신의 로그와 함께 해결하기 위해 몇 가지 힌트를 얻을 희망 ic !!!
"라인 삭제"란 무엇을 의미합니까? 'array == 2'는 무엇을해야합니까? 모든 포인트가 동일하다는 점만 복사 및 붙여 넣기 버그입니까? –
https://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CGContext/Reference/reference.html#//apple_ref/c/func/CGContextClearRect – iPatel