today tutorial is about view.
first is base conception of view.
second is in the activity obtain view object.
third is setting view attributes.
fourth is for view set listener.
ok,the beginning of the next.
ONE:
what is view.view is a visible view.contain it's subclass textview,imageview,edittext,button...A View occupies a rectangular area on the screen and is responsible for drawing and event handling.
View is the base class for widgets, which are used to create interactive UI components (buttons, text fields, etc.).
two:
in that way we how in activity obtain view object?there are two kinds of circumstances.frist is view object in xml.second is view in java instance.if you is frist need usr findviewByid interface,or you is second new View() when this you already finded
view object.
Three:
first function in xml setting,second in java file setting.Generally in xml setting common attribute.in java file setting special attribute.
example:in textview set width and height but the contents of textview need dynamic change,so our need in java file set contents of textview(maybe write in the listener
function).of cause, this is a simple examle.
Four:
in order to view set listener.the view(textview edittext imageview button...) maybe be used user operation.example long click,short click,roll,edit so need set listener.
how to in order view binding listener?
Is divided into four steps.
1,obtain represents the control object.
2,define a class implement listener interface.
3,create listener object.
4,in order view binding listener object.