开发者

How do I change the size of my header section?

开发者 https://www.devze.com 2023-03-01 20:32 出处:网络
I\'d like to change the size of the header of my section and I do not really know what to do. Can you help me please?

I'd like to change the size of the header of my section and I do not really know what to do.

Can you help me please? Here is the code:

// 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(开发者_JAVA百科mailtf);
section1.add(row1);
....
etc 


You're looking for a custom header so you need to do a view rather then title. Replace headerTitle with 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


well, I do not use appcelerator, but it looks like it integrates with native function and delegate calls on objective c. For setting new header size and personalized views try this 2 methods:

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

and:

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


Use this method

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

精彩评论

暂无评论...
验证码 换一张
取 消