0

Is it possible to add buttons to table views? I am trying to create a screen that resembles a settings screen on the iPhone.

I know you are able to add the little arrow that represents that the list has a child but what I'm specifically looking for is how to add a plus button to the right side of my table view.

1
  • Are you using Alloy or classic Titanium (Javascript only)? Commented Oct 1, 2014 at 5:59

1 Answer 1

1

You need to add a button to the row. That means you need to create a custom row. It's much simpler. Try the following

function createRow(){  
    var tableRow = Ti.UI.createTableViewRow({
        hasChild : false,
        width    : '100%',
        height   : 55,
    });

    var addButton = Ti.UI.createButton({
        title    : '+',
        width    : 40,
        height   : 40,
        right    : '3%'
    });

    addButton.addEventListener('click', function(){
        alert("Hey, you clicked + button");
    });

    tableRow.add(addButton);

    return tableRow;
}

The above code creates a customized row. Hope it helps you. Let me know if you have any questions.

Sign up to request clarification or add additional context in comments.

1 Comment

@ThomasMcDonald: From your previous question, assuming that you are using classic Titanium.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.