첨부 된 이미지 (LHR-SYD/372 결과)와 비슷한 UITableView
에 고정 된 투명 헤더를 추가하려고합니다. 이것은 xcode/ios의 "기본 제공"구성 요소입니까, 아니면 어떻게 완료됩니까?UITableView에서 고정 된 투명 헤더
3
A
답변
7
사용 방법이 뷰를 설정하는 방법은 전술
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section;
.
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section;
위의 제목 설정 방법. 당신이 당신의 headerview에 다른 개체를 추가 할 수 있습니다 방법보다 사용하여,
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UILabel *lbl = [[[UILabel alloc] init] autorelease];
lbl.textAlignment = UITextAlignmentLeft;
[email protected]"LHR-SYD/372 Results";
return lbl;
}
을이 하나를 참조하십시오.
(OR)
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
return @"LHR-SYD/372 Results";
}
이 하나 귀하의 요구 사항은 난 그렇게 생각합니다.
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
return 30;
}
당신은 실제로 UITableView
의 기본 헤더 인이 코드
1
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *transparentView=[[UIView alloc]initWithFrame:CGRectMake(0,0,320,10)];
transparentView.backGroundColor=[UIColor clearColor];
return transparentView;
}
1
를 사용하여 헤더 뷰의 높이를 설정할 수 있습니다. titleForHeaderInSection
메소드를 구현하면 표시됩니다. 해당 방법에 대한 설명서를 확인하십시오. 많은 도움이됩니다.
0
예, 내장되어 있습니다. 첨부 된 스크린 샷은 섹션을 사용하는 UITableView
입니다. this tutorial을 참조하십시오.
섹션 헤더의보기를 사용자 정의 할 수도 있습니다. [tableView:viewForHeaderInSection:]
(http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableViewDelegate_Protocol/Reference/Reference.html)을 참조하십시오. 그러나, 당신이 볼 수있는 것은 기본 뷰이므로 섹션과 titleForHeaderInSection
만 구현하면됩니다 (자습서 참고).
2
당신은 기본 헤더보기 BG 변경할 수 있습니다
- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section {
UITableViewHeaderFooterView *header = (UITableViewHeaderFooterView *)view;
header.backgroundView.backgroundColor = [header.backgroundView.backgroundColor colorWithAlphaComponent:1];
}
관련 문제
- 1. 고정 된 UITableView에서 고르지 않은 섹션 헤더 크기
- 2. ListView에 고정 된 투명 헤더를 붙이시겠습니까?
- 3. 정적의 TableView 투명 헤더
- 4. UITableView에서 고정 된 배경보기를 만드는 방법?
- 5. 중첩 된 NSArray의 UITableView에서 다른 섹션 헤더
- 6. 고정 된 수평 테이블 헤더
- 7. 스크롤하는 동안 고정 된 헤더
- 8. 고정 된 헤더 위의 갭
- 9. 헤더, 컨테이너와 고정 된 위치
- 10. 투명 고정 텍스트 변경
- 11. 고정 헤더의 반응하는 투명 로고
- 12. 고정 헤더 및 여백
- 13. GridView 고정 헤더 행
- 14. 고정 헤더 만들기
- 15. 고정 시차 헤더 이미지
- 16. 마진이나 패딩이없는 페이 스북 고정 된 헤더
- 17. 고정 된 헤더 뒤에 나타나는 컨텐츠
- 18. 투명성이 필요한 고정 헤더
- 19. 고정 헤더 FadeOut, FadeIn
- 20. Wordpress 투명 헤더 및 본문
- 21. Android : 스크롤되는 고정 헤더 또는 유사 헤더
- 22. JQuery - 고정 배너가있는 고정 테이블 헤더
- 23. gridview 고정 헤더 및 고정 바닥 글
- 24. Datatables의 여러 고정 헤더
- 25. Jqtouch의 고정 헤더
- 26. Datagridview 고정 헤더 행
- 27. css 고정 헤더 오버플로?
- 28. jquery에서 테이블 헤더 고정
- 29. IE 고정 헤더
- 30. IE9의 고정 헤더 버그?
도와 주셔서 감사합니다 여러분 모두에게 많은 – user1448401