Ho un UIView e due sotto-visualizzazioni in esso. Le sottoview hanno angoli arrotondati e un valore di confine. Il problema che ho è che i bordi esterni del bordo arrotondato contengono una linea sottile del colore di sfondo subview. Devo mancare qualcosa ??UIView con angolo arrotondato e bordo ha il colore del bordo sbagliato
UIView *outerView = [[UIView alloc] initWithFrame:CGRectMake(0, 50, 320, 320)];
[self.view addSubview:outerView];
outerView.backgroundColor = [UIColor whiteColor];
UIView *innerView1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 160, 320)];
[outerView addSubview:innerView1];
innerView1.backgroundColor = [UIColor blackColor];
innerView1.layer.borderWidth = 20;
innerView1.layer.borderColor = [UIColor whiteColor].CGColor;
innerView1.layer.cornerRadius = 20;
//innerView1.layer.masksToBounds = YES;
UIView *innerView2 = [[UIView alloc] initWithFrame:CGRectMake(160, 0, 160, 320)];
[outerView addSubview:innerView2];
innerView2.backgroundColor = [UIColor blackColor];
innerView2.layer.borderWidth = 20;
innerView2.layer.borderColor = [UIColor whiteColor].CGColor;
innerView2.layer.cornerRadius = 20;
//innerView2.layer.masksToBounds = NO;
//innerView2.clipsToBounds = YES;
//innerView2.layer.shouldRasterize = YES;
Sarebbe utile includere uno screenshot che mostra il rilevante problema. – rmaddy
Ho eseguito il codice con uno sfondo verde e questo è quello che sto ottenendo -> http://puu.sh/89bjO/6e551e085e.png è quello che stai ottenendo? Non sto davvero confrontando il tuo problema con quello che sto ricevendo –
Ora vedo il tuo errore. Sto scherzando con il codice per vedere cosa sta causando questo. –