0
이 탐색 바코드를 추가하지만 왼쪽 항목 항목 단추 "편집"을 클릭 할 수 없으며 텍스트 상자로 바꾸어도 작업하지 않습니다 (값을 가져 가지 않음). 이 코드에 무엇이 잘못되었는지 알아낼 수 있다면 나는 당신에게 아주 도움이 될 것입니다.탐색 모음 단추를 클릭 할 수 없습니다.
감사합니다,
Aashish
화면이 [자기 editButtonItem] 대신 self.editButtonItem의 시도 http://www.flickr.com/photos/[email protected]/6440926473/in/photostream
-(void) initializeNavigationalBar {
UIToolbar* _leftNavBarTools = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 300, 44.01)];
// create the array to hold the buttons, which then gets added to the toolbar
NSMutableArray* _leftNavBarButtons = [[NSMutableArray alloc] initWithCapacity:4];
UIBarButtonItem* _editScenarioProduct = self.editButtonItem;
UIBarButtonItem* _addTurftype = [[UIBarButtonItem alloc] initWithTitle:@"Turftype" style:UIBarButtonItemStyleBordered target:self action:@selector(getTurfType)];
UIBarButtonItem *_addTargetN = [[UIBarButtonItem alloc] initWithTitle:@"Target N" style:UIBarButtonItemStyleBordered target:self action:@selector(getTargetNperWeek)];
UIBarButtonItem *_addMapRegion = [[UIBarButtonItem alloc] initWithTitle:@"Map Region" style:UIBarButtonItemStyleBordered target:self action:@selector(getMapRegion)];
CGRect _textFrame = CGRectMake(0, 0, 80, 30);
_turfacresTextField = [[UITextField alloc] initWithFrame:_textFrame];
_turfacresTextField.borderStyle = UITextBorderStyleRoundedRect;
_turfacresTextField.font = [UIFont systemFontOfSize:12.0];
_turfacresTextField.placeholder = @"Turf Acres";
_turfacresTextField.textAlignment = UITextAlignmentCenter;
_turfacresTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
_turfacresTextField.autocorrectionType = UITextAutocorrectionTypeNo; // no auto correction support
_turfacresTextField.keyboardType = UIKeyboardTypeDefault;
_turfacresTextField.returnKeyType = UIReturnKeyDone;
UIBarButtonItem *_addTurfacres = [[UIBarButtonItem alloc] initWithCustomView:_turfacresTextField];
[_leftNavBarButtons addObject:_addTurftype];
[_leftNavBarButtons addObject:_addTargetN];
[_leftNavBarButtons addObject:_addMapRegion];
[_leftNavBarButtons addObject:_addTurfacres];
[_leftNavBarButtons addObject:_editScenarioProduct];
[_leftNavBarTools setItems:_leftNavBarButtons animated:NO];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:_leftNavBarTools];
UIToolbar* _rightNavBarTools = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 200, 44.01)];
// create the array to hold the buttons, which then gets added to the toolbar
NSMutableArray* _rightNavBarButtons = [[NSMutableArray alloc] initWithCapacity:4];
UIBarButtonItem *_addSoilSetting = [[UIBarButtonItem alloc] initWithTitle:@"Settings" style:UIBarButtonItemStyleBordered target:self action:@selector(setSoilandCarryover)];
[_rightNavBarButtons addObject:_addSoilSetting];
UIBarButtonItem* _addApplication = [[UIBarButtonItem alloc] initWithTitle:@"Add Appplication" style:UIBarButtonItemStyleBordered target:self action:@selector(addApplication)];
[_rightNavBarButtons addObject:_addApplication];
[_rightNavBarTools setItems:_rightNavBarButtons animated:NO];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:_rightNavBarTools];
}
고마워,하지만 내 질문을 게시 한 후 나는 도구 모음의 크기가 작은 다음 단추의 크기를 추가 잡았어. –