N
N
Neonoviiwolf2017-02-14 17:36:32
Java
Neonoviiwolf, 2017-02-14 17:36:32

How to properly remove a View from a container?

Good!
The LinearLayout contains a View with a Button, when you click on this Button View should be deleted, I suppose the child should not delete itself, how is this done correctly in java?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Zagaevsky, 2017-02-14
@Neonoviiwolf

LinearLayout.removeView(childView); in onClickListener'e if needed. The listener is not part of the button itself, so it won't "delete itself".
PS I can see directly from the questions that you are going further and further the wrong way.

D
davidnum95, 2017-02-14
@davidnum95

setVisibility(View.GONE) ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question