Amount Directly on the properties.
TextView view;
View.setvisibility (view.visible);
Here are three properties. Visible, respectively. Invisible hidden. And one is gone. This property refers to not occupying space after the control is hidden.
The same is true in XML. It is possible to define the visibility attribute directly.
All right. Now look at how the ListView is implemented.
The monitor function of the Click event of the ListView is this
Mylist.setonitemclicklistener (New Onitemclicklistener () {
@Override
public void Onitemclick (adapterview<?> arg0, View arg1, int arg2,
Long Arg3) {
}
});
This function has four parameters. First arg0. This is not a common use. It's for the system. The system automatically passes in the call.
The key is the second parameter. He is a type of view. I can not help but have doubts. This view is the view that is found after viewing the data. This view is the view of the item you clicked on. So. It seems to be a bit of a prospect.
Sets the hidden and visible controls. The first thing to get is this control. Now you have the view that contains the control. It's easy to get this control. You can do it with Findviewbyid.
Once you have this control, you can use setvisibity to set its visible hidden properties.
I did a textview. The image above.
This is not before the click. See only three textview at the bottom.
This is after clicking on the item. Found one more textview.
Have you learned it. Kiss..