1

I have a tableView with multiple TableViewRow objects, always 4. When the edit button is clicked the row can be reordered, which is working.

But when the edit button is clicked the elements inside of a row seem to be moved with margins from left and right.

The items in a row should not be moved, so I was hoping someone could tell me how I can make sure the labels inside a row element are not being moved around when edited.

I have included some images, hoping to clarify my question:

The rows when NOT edited Rows when not edited

Rows when being edited Rows when edited

2 Answers 2

4

The solution was easy, but I didnt know.

The way to achieve this; Add a view to each row and do NOT set the left or right properties. This way the delete button and move icon are not pushing the inner view away.

3
  • You should click the check mark beside this answer, if it answers your question. Dec 21, 2012 at 12:39
  • I know, but I cant for 2 days. "You can accept your own answer in 2 days (click on this box to dismiss)" So that's why I did not check it yet, sorry but I just can not.. Dec 21, 2012 at 13:13
  • No problem! It's listed as the solution now! Dec 24, 2012 at 10:05
-1

Its a default behavior. I dont think there's any way defined in Titanium API to override the moving of inner elements. So you cannot change this default behavior.

2
  • I don't understand it's behaviour. The row has an inner view containing everything. No matter what the width of the view even if it is 90px it's always being moved. Dec 21, 2012 at 12:01
  • Hasnain, I got it fixed. The solution was to not set the left or right properties on the inner view. I have a different question now though. Is it possible to hide certain elements of each row when they are being edited? Dec 21, 2012 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.