1.TextView
Setting the layout file in Res/layout
Hint property: Prompt for input information
Text property: The difference from hint---hint is just a hint;
Text is the actual content
Introducing the layout XML file into the activity
Setcontentview (r.layout.main_activity); Associate a layout file with the current file
Wrap_content: Wrapping the actual text content
Fill_parent: The current control is covered with a parent container (before 2.3)
Match_parent: The current control fills the parent container (a property added after this 2.3api is currently used
2.ImageView
1. What is ImageView:
is a control that displays a picture
2.ImageView Properties:
android:src= content image for "@drawable/ic_launcher"--imageview
android:background= "@drawable/ic_launcher"---imageview background image
Android:background= "#00ff00"----RGB color of ImageView
3, android:orientation vertical placement;
4. The difference between the SRC attribute and the background attribute in ImageView:
SRC dimensions do not change with the size of the control, just refer to the picture
The size of the background is always the same as the size of the control, like a fill effect, filling the picture with controls
SRC and background can coexist in the same control
2.BUtton Click event
Both 1.Button and ImageButton have a Onclik event that adds a click event through their own. Setonclicklistener (Onclicklistener) method.
2. All controls have an OnClick event, not just button and ImageButton have
3. Click on the event of the listener can achieve the Click button after the action of what to happen
Several ways to listen for event implementations:
1. Implementation of anonymous inner classes
2. Implementation of independent classes
3. Implement the interface way to achieve
Using TextView and TextEdit