iOS> 4의 탐색 모음에 여러 개의 버튼을 추가하는 방법은 무엇입니까?여러 단추를 추가하는 방법 iOS> 4?
iOS> 5의 경우 해당 속성이 있지만 iOS 4에서도이를 지원하는 방법은 알고 있습니다.
세그먼트 검색을 사용하여 게시물을 제안했지만 나에게 2 개의 버튼을 구분하여 표시하고 싶습니다.
달성 할 수 있습니까?
iOS> 4의 탐색 모음에 여러 개의 버튼을 추가하는 방법은 무엇입니까?여러 단추를 추가하는 방법 iOS> 4?
iOS> 5의 경우 해당 속성이 있지만 iOS 4에서도이를 지원하는 방법은 알고 있습니다.
세그먼트 검색을 사용하여 게시물을 제안했지만 나에게 2 개의 버튼을 구분하여 표시하고 싶습니다.
달성 할 수 있습니까?
:
self.firstButton =
[[[UIButton alloc] initWithFrame:CGRectMake(0, 6, 36, 32)] autorelease];
self.secondButton =
[[[UIButton alloc] initWithFrame:CGRectMake(38, 6, 36, 32)] autorelease];
UIView *rightView =
[[[UIView alloc] initWithFrame:CGRectMake(0, 0, 75, 44)] autorelease];
rightView.backgroundColor = [UIColor clearColor];
[rightView addSubview:firstButton_];
[rightView addSubview:secondButton_];
self.navigationItem.rightBarButtonItem =
[[[UIBarButtonItem alloc] initWithCustomView:rightView] autorelease];
참고 : 여전히 iOS 7.1에서 작동합니다. – Colin
당신은 아마 당신은 하나의 세그먼트 또는 사용자 정의 UIButton
와 segmentControl를 사용할 필요, 일부 사용자 지정 버튼을 사용하고이 UIView
되지 않기 때문에이 방법 UIBarButtonItem
을 추가하지 못할 [navigationBar addSubview:customButton];
으로 탐색 모음에 추가 할 수 있습니다.
시도'[내비게이션 바 addSubview : customButton]'당신은 UIBarButtonItem'이 방법, 아마 당신이 segmentControl를 사용할 필요가'추가 기운 다 하나의 세그먼트 또는 맞춤 검색 버튼 – iDev
고마워, 내가하려고합니다 – Rendy
봐 [이] (http://stackoverflow.com/questions/1414510/how-do-you-add-more-than-one-uibarbutton-on-uinavigationitem-rightbarbuttonitem) 그래서 질문, 그것은 당신을 도울 것입니다. –