Dashboard Like cross Button

You must Login before you can answer or comment on any questions.

How can i create a dashboard(Titanium.UI.createDashboardView) Like cross button. Actually i dont know how to position it top-left or top right like dashboard. Please help ..

2 Answers

What do you mean "cross button?"

You can use a standard view (Ti.UI.createView) created as a child element of a larger view, and then listen for the click event on the child view, if you'd like. For instance:

// This makes the holder. You can add a background image/etc. to this view
var holder = Ti.UI.createView({
    top: 0,
    bottom: 0,
    left: 0,
    right: 0
});
 
// This would be a menu item. 
var button = Ti.UI.createView({
    top: 10,
    left: 10,
    width: 100,
    height: 100,
    backgroundColor: "#0000FF"
});
 
// Here is where the click is registered
button.addEventListener("click",function(eventObject){
    // Do stuff here
});
 
holder.add(button);
You would then need to add the holder to your main window. Hope this helps!

— answered 10 months ago by Beejay Morgan
answer permalink
20 Comments
  • I checked it , This is creating a view with in the holder view.. Did u check the Dashboard view cross button ..

    — commented 10 months ago by Gaurav Sood

  • I'm not sure what you mean by "cross button." Is that a button that's in the Kitchen Sink app?

    — commented 10 months ago by Beejay Morgan

  • Yes please check Dashboard view in kithcen sink , when you touch and hold any of icon you will saw a cross button . onclicking it removes the icon. I need to impiment same in my app. Actually what i need to view I am validating user's credentials if those are not correct i am showing it in a view .. a message view.. Now i want a cross button same as dashboard view to hide it again

    — commented 10 months ago by Gaurav Sood

  • Show 17 more comments

Your Answer

Think you can help? Login to answer this question!