Android self-examination notes

1. Linear Layout:
Horizontal Vertical
android: orirntation = "vertical" vertical, the other horizontal,

2. button on the right:
<the Button
Android: layout_width = "wrap_content"
Android: layout_height = "wrap_content"
Android: the above mentioned id = "@ + the above mentioned id / bu_deng"
Android: text = "Login"
Android: layout_alignParentRight = "to true" // button is placed right
/>

 

3. Controls from top to bottom is marginTop = "20dp"

 

4. Remove our user name and password
String

Analyzing string variable str, string is not empty
method of detecting an empty string
IF ( "." The equals (name))
{

}
fritters method of
IF (TextUtils.isEmpty (name))
{

}

 

The cipher text operation, the password is not shown as a star
android: password = "true"


6. Examples of a the TextView
the TextView TV1 = (the TextView) the findViewById (R.id.tv_denglu);

 

7. File icon folder
D: \ Example_android \ layouttt \ app \ src \ main \ res \ mipmap-xxhdpi


8. toast display
Toast.makeText (MainActivity.this, "You password or account is empty", Toast.LENGTH_SHORT) .show ();

 

9. The interface conversion

Intent my1 = new Intent(sman.this, s208.class);

startActivity(my1);


10. The linear layout of the vertical layout

android: orientation = "vertical" 

horizontal layout
android:orientation="horizontal"



11. anonymous inner classes, written in Oncreate inside
= Bb_210 the Button (the Button) the findViewById (R.id.b210); 
bb_210.setOnClickListener (new new View.OnClickListener () {
@Override
public void the onClick (View V) {
the Intent MMY the Intent new new = (sman.this, s210.class) ;
startActivity (MMY);
}
});

12 is, image files referenced in the xml file
Eclipse: Android: background = "@ the drawable / Sliding"
AS: Android: background = "@ as mipmap / Sliding"


13.
Android: layout_marginStart: if in the layout pattern LTR, which is equivalent to the attribute android: layout_marginLeft. If the layout in the RTL mode, which is equivalent to the attribute android: layout_marginRight.








Guess you like

Origin www.cnblogs.com/gzyx/p/11439358.html