UINavigationController 내에 UITableView가 있습니다. 테이블 셀과 함께 움직이지 않는 화면 아래쪽에 도구 모음을 만들려면 UIView를 하위보기로 탐색 막대에 추가했습니다.UINavigationBar 및 터치 이벤트의 하위 뷰에 프로그래밍 방식으로 UIButton 추가하기
이 UIView를 추가하기 위해 프로그래밍 방식으로 UIButton을 생성합니다. 선택기를 추가했지만 등록하지 않았고 함수를 호출하여 (sendMessage) 설정했습니다.
어떤 아이디어?
self.sendBar = [[UIView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height-100, self.view.frame.size.width,100)];
self.sendBar.backgroundColor = cloudBlue;
UIButton *sendButton = [[UIButton alloc] initWithFrame:CGRectMake(0,0,50,50)];
sendButton.backgroundColor = [UIColor blackColor];
[sendButton addTarget:self action:@selector(sendMessage) forControlEvents:UIControlEventTouchUpInside];
[self.navigationController.navigationBar addSubview:self.sendBar];
[self.sendBar addSubview:sendButton];