danielo 007
danielo 007

Reputation: 25

How can I remove a button from a Screen using Ruby Motion

I can manage to remove an image

def remove_image
    @button_image.removeFromSuperview
end

But what script works in order to remove a button?

Upvotes: 0

Views: 36

Answers (1)

vacawama
vacawama

Reputation: 154711

A button is a subclass of a UIView so you can remove it the same way:

@button.removeFromSuperview

Alternatively, you can just hide the button:

@button.hidden = true

Upvotes: 0

Related Questions