TableViewRow left offset no support in Titanium

Interested in a hands-on tutorial in Titanium? Building Cross-Platform Apps using Titanium, Alloy, and Appcelerator Cloud Services

While creating the layout for our Mobile App project, there was one Window where the TableViewRows should have a border at the bottom. I thought the separatorColor property would solve it but this was the result in iOS7 simulator: TableViewRowBug
As you can see, there’s a gap on the left side of the Window and the fix for this “bug” on Titanium will be released on December 9 2013, well our project cannot wait for a long time. I saw some hacks from other websites like adding a View inside the TableViewRow, etc.., but none of them really work for me. So I tried to hack it on my own and I managed to solve our problem by inserting a TableViewRow with a different property.

Now this is the result we had:

TableViewRoxFix

The height of the TableViewRow you’ll be inserting should be 1dp and change the backgroundColor to the color you need.

Quick Tips:

Our TableViewRows and the other elements in our project are added dynamically.

Here’s how we did it:

You can’t add a TableViewRow in a TableView, so you should first create an Array e.g var rowArray = []; then push the TableViewRow inside the array e.g rowArray.push(newTableViewRowName); and finally set the TableView data to the rowArray YourTableView.setData(rowArray);

Hope this will help you in some way.



About Rhys Coronado

Resident Jedi Master, combines the way of the Saber with Jeet Kun Do (well in his dreams :P ) Titanium Appcelerator Developer, he also helps with some Web stuffs. He makes sure he is always M.A.D (Making a Difference) a positive one of course, he also loves to BoBo (Bring Out the Best in Others). "Stop conforming, make a positive difference! It all starts with the right mindset."

One thought on “TableViewRow left offset no support in Titanium

  1. Lynn says:

    I solved this by putting the ‘left’ of my TableView as -20, and the left of my TableViewRow as 40.

Leave a Reply

Your email address will not be published. Required fields are marked *


*