1
I UIToolbar
는 (A)에 추가 된 UISegmentedControl
가 사라진다 :제목, 프로그램
UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:toolbarFrame];
toolbar.barStyle = UIBarStyleBlack;
toolbar.translucent = YES;
toolbar.barTintColor = [UIColor colorWithRed:0.97 green:0.97 blue:0.97 alpha:1.0];
[self.view addSubview:toolbar];
UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:@[@"Last week", @"Last month", @"All time"];
[segmentedControl setSelectedSegmentIndex:0];
[toolbar addSubview:segmentedControl];
툴바이어서 뷰 컨트롤러에 추가된다. View Controller의 스크린 샷을 찍을 때 이상한 일이 발생합니다. 선택한 세그먼트의 제목이 사라집니다.
스크린 샷을 사용하여 촬영하고 있습니다 :
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, YES, [[UIScreen mainScreen] scale]);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
렌더링보기 :
스크린 샷 :
을 이해할 수있을 것이다 찾고 시작하는 위치에 대한 모든 포인터가.
하나의 아이디어가 있습니까? drawViewHierarchyInRect : afterScreenUpdates : YES가 우리에게 다른 문제가 있습니다 ... – x2on
'drawViewHierarchyInRect : afterScreenUpdates :'의 원인은 무엇입니까? –
가끔 느린 경우 – x2on