text alignment of tableViewRows
Hi there,
I'm new to appcelerator.
I'm trying to create a simple vertical menu. Each menu item has a nice glossyback.png background to it with the title text displayed over the background. The issue that I have is that the text is left aligned by default and I cannot for the life of me figure out how to center the text in the column. Please could someone help me with this or perhaps suggest a better way to achieve the same thing?
Here is the code:
var data = [];
data[0] = Ti.UI.createTableViewRow(
{
title:'Featured',
backgroundImage:"/images/glossyback.png"
});
data[1] = Ti.UI.createTableViewRow(
{
title:'Categories',
backgroundImage:"/images/glossyback.png"
});
data[2] = Ti.UI.createTableViewRow(
{
title:'Search',
backgroundImage:"/images/glossyback.png"
});
data[3] = Ti.UI.createTableViewRow(
{
title:'Download Zone',
backgroundImage:"/images/glossyback.png"
});
var tableview = Titanium.UI.createTableView({
data:data
});
TIA
D~
1 Answer
-
Accepted Answer
You need to create a custom row for this.
Create a label , align it centered and add it to the row.Here you have a small tutorial about custom rows
http://cssgallery.info/custom-row-for-tableview-in-appcelerator-titanium/