이 내가 형태로 촬영 한 코드입니다 .....이 사용자 정의 uialertview는 어떻습니까?
- (void)willPresentAlertView:(UIAlertView *)alertView
{
[[[alertView subviews] objectAtIndex:2] setBackgroundColor:[UIColor colorWithRed:0.5 green:0.0f blue:0.0f alpha:1.0f]];
}
- (void) presentSheet
{
UIAlertView *baseAlert = [[UIAlertView alloc]
initWithTitle:@"Alert" message:@"This alert allows the user to choose between a 'safe' and a 'deadly' choice, indicated by button color.\n\n\n\n"
delegate:self cancelButtonTitle:nil
otherButtonTitles:@"Deadly!", @"Safe", nil];
UITextField *txtFld = [[UITextField alloc] initWithFrame:CGRectMake(60,10,240,31)];
[txtFld setDelegate:self];
[txtFld setBackgroundColor:[UIColor clearColor]];
[baseAlert addSubView:txtFld];
[txtFld release];
[baseAlert show];
}
는 사과의 제공 UIControls의 기본 모양과 느낌을 변경할 수있는 경우 내가 어떤 이유로 사과 것을 볼 해달라고 때문에 내 질문입니다 이러한 유형의 맞춤 설정을 허용해서는 안됩니다.
텍스트 필드, 버튼 등을 추가하는 것과 같은 하위보기를 추가해도 사과로 인해 약간의 문제가 있습니까? –
그럴 수도 있습니다. 예를 들어 UITextField를 하위보기로 추가 한 다음 bringSubviewToFront : 메시지를 보내면 벗어날 수 있습니다. 그러나이 경우조차도 나머지 경고 뷰를 "늘려야"할 것이므로 여전히 내부를 망칠 것입니다. 장기적으로 볼 때 자신 만의 시각을 만드는 것이 더 나을 것입니다. – bpapa