UIBarButton을 만들고 코드를 사용하여 툴바에 추가하려고했습니다. 앱을 실행 한 후 내 버튼 테두리가 누락되었습니다. 내 코드는 아래와 같습니다.목표 C : 도구 모음의 UIBarButton 경계가 없습니다.
//Add toolbar to the UITable View
toolbar = [[UIToolbar alloc] init];
toolbar.barStyle = UIBarStyleDefault;
toolbar.frame = CGRectMake(0, 436, 320, 50);
//Set the toolbar to fit the width of the app.
[toolbar sizeToFit];
UIBarButtonItem *flexButton =[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:nil
action:nil];
UIBarButtonItem *nextButton = [[UIBarButtonItem alloc]initWithTitle:@"Who Paid?"
style:UIBarButtonItemStylePlain
target:self
action:nil];
NSArray *buttonItems = [[NSArray alloc]initWithObjects:flexButton, nextButton, nil];
[self.toolbar setItems:buttonItems];
[self.navigationController.view addSubview:toolbar];
[buttonItems release];
[flexButton release];
[nextButton release];
[toolbar release];
내가 어떤 단계를 놓치게이나되었다 실수가 있습니까? 이것에 대한 도움은 크게 감사하겠습니다.
감사합니다. 젠
버튼에 'UIBarButtonItemStylePlain' 이외의 스타일을 사용해 보셨습니까? –
예. 감사합니다. 나는 국경이있는 것을 발견했다. 고마워요. – Zhen