2011-04-28 7 views
1

내 섹션 헤더의 크기를 변경하고 싶습니다. 어떻게해야할지 잘 모릅니다.헤더 섹션의 크기는 어떻게 변경합니까?

제발 도와 주실 수 있습니까? 다음은 코드입니다 :

// create tab group 
var tabGroup = Titanium.UI.createTabGroup({ 

}); 

var win= Titanium.UI.createWindow({ 
    title:'', 
    tabBarHidden: true, 
    barColor:'black', 
    backgroundColor:'white' 
}); 

var tab= Ti.UI.createTab({ 
    title:'//////', 
    window:win 
}); 

var view = Titanium.UI.createView({ 
    backgroundColor: "#FFFEEE" 
}); 

var section1 = Titanium.UI.createTableViewSection({ 
    headerTitle:"text long enough " 
}); 

var row1 = Ti.UI.createTableViewRow({ 
    height:'auto', 
    selectionStyle:Ti.UI.iPhone.TableViewCellSelectionStyle.NONE 
}); 

var label1 = Titanium.UI.createLabel({ 
    text:'////// :', 
    font:{fontSize:16,fontWeight:'bold'}, 
    left: 10 
}); 

var mailtf = Ti.UI.createTextField({ 
    left: 75, 
    right:10, 
    borderStyle: Ti.UI.INPUT_BORDERSTYLE_NONE 
}); 

row1.add(label1); 
row1.add(mailtf); 
section1.add(row1); 
.... 
etc 

답변

1

:

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section; 

과 : 새로운 헤더 크기와 개인화 된 뷰의 설정 방법 이 2 가지 방법을 시도해보십시오. 감사는 나에게 정확히 미안 해요 추가 할 수도 있습니다 그렇게 무서워하지만 난 정말 Appcelerator로 시작 OULA headerView

https://github.com/appcelerator/KitchenSink/blob/master/Resources/examples/table_view_api_custom_header.js#L33

http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.TableViewSection-object#headerView

+0

나는 너를 사랑 스럽다. 나는 그것을하려고 노력할 것이고 나는 결과에 대해 계속 알려줄 것이다. – Sabrina

+0

대단히 감사하다. nikel 나는 변화를 만들었지 만 거기에는 변화가 있었지만 거기에는 같은 텍스트 색깔이있다. 헤더 부분에 대한 기본값을 설정 나는 검은 색 은 대단히 감사를 좋아하기 때문에이 색상 같은 것을 넣어야 할 – Sabrina

+0

난 당신이 스택 오버플로를 처음 5 질문은 어떤 선택 대답을하지 않으려가 발견 @Sabrina? 우수 답변 기능이 어떻게 작동하는지 이해하고 싶었습니다. http://meta.stackexchange.com/questions/30957/what-answer-should-i-choose-as-the-correct-answer-for-my-question – bh88

0

사용

(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section 
{ 
    return 44; //change according to your condition 
} 
+0

headerTitle 교체 – Sabrina

1

가 아니라, 내가 appcelerator를 사용하지 않는이 방법하지만 기본 기능을 통합하고 대리인이 목표 다 부르는 것 같습니다. 당신이 다음 오히려 제목을보기를 할 필요가 있도록 사용자 정의 헤더를 찾고

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section; 
+0

나는 그것을 제공하기 때문에이 코드를 삽입해야하는 곳하시기 바랍니다 나이 오류를 섹션의 선언 바로 뒤에 넣을 때 – Sabrina

+0

[object TiUITableViewRow]에 나타나는 자동 오류 값이 0입니다.이 뷰는 표시되지 않을 수 있습니다. – Sabrina

관련 문제