2012-04-07 4 views
0

그래서 아래에있을 수 있도록, 내 테이블보기에 바닥 글을 추가하려면이 방법을 구현 한 :장소 jQuery과 바닥 글에있는 버튼을있는 UITableViewCell이 아닌 바닥 글

:이 결과

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section 
{ 
    return 60; 
} 

enter image description here

지금, 당신이보고, 두 가지 문제가 있습니다 :

1) 나는 버튼을 드래그 할 때 나는 테이블 뷰 바닥 글 내부에 버튼을 추가 할하지만 것 스토리 보드에서 컨트롤이 작동하지 않습니다. 버튼을 추가하는 방법은 무엇입니까?

2) 보시다시피, 바닥 글은 투명하며 그 아래에 표보기 셀이 있습니다. 꼬리말 아래에 셀이 없기를 바랍니다 (마지막으로 보이는 셀은 바닥 글 위의 셀이됩니다). 둘째, 나는 바닥 글을 투명하게 보이지 않게하고 싶다.

Xcode 4.2 및 Snow Leopard를 사용하고 있습니다.

답변

2
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section 

은 대리인 메서드입니다. 대신 테이블의 속성 sectionFooterHeight에 액세스하십시오.

단추를 추가하려면 사용자 지정보기를 바닥 글에 추가하는 것이 좋습니다. tableFooterView에 액세스하여 사용자 정의보기를 할당 할 수 있습니다.

+0

나는 그것을했다. sectionFooterHeight를 사용했는데 이제 바닥 글이 전혀 나타나지 않습니다. –

1

당신이있는 tableView를 사용할 수 있습니다 viewForFooterInSection : 방법은 아래 tableviews의 바닥 글에

1

증가 contente 크기 버튼을 추가

UIEdgeInsets contentInset = self.tableView.contentInset; 
contentInset.bottom = 50.0f; // **the height of the footer** 
self.tableView.contentInset = contentInset; 
+0

self.myToolbar 란 무엇입니까? –

+0

은 모든 높이 일 수 있으며, 일부 코드의 사본 일 수 있습니다. 편집을 참조하십시오. – FoJjen

2

사용하여 테이블 바닥 글보기를 만들려면이 기능

- (UIView *) createViewForTableFooter 
{ 
    CGRect footerRect = CGRectMake(0, 0, self.view.frame.size.width, 60); 
    UIView *tableFooter = [[[UIView alloc] initWithFrame:footerRect] autorelease]; 
    tableFooter.backgroundColor = [UIColor clearColor]; 

    UIButton* verifyButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 
    [verifyButton setTitle:WNLocalizedString(@"Verify",@"") forState:UIControlStateNormal]; 
    [verifyButton.titleLabel setFont:[UIFont boldSystemFontOfSize:20]]; 
    [verifyButton addTarget:self action:@selector(verifyBtnTapped:)forControlEvents:UIControlEventTouchUpInside]; 
    verifyButton.autoresizingMask = UIViewAutoresizingFlexibleWidth; 
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { 
     [verifyButton setFrame:CGRectMake(44, 10, self.view.frame.size.width - 88, 37)]; 
    }else { 
     [verifyButton setFrame:CGRectMake(10, 10, self.view.frame.size.width - 20, 37)]; 
    } 
    [tableFooter addSubview:verifyButton]; 

    return tableFooter; 
} 

그리고이 기능을 viewDidLoad 메서드에서 다음과 같이 사용하십시오 :

yourTableObjectName.tableFooterView = [self createViewForTableFooter];