一世澜、TextView
二署穗、EditView
三、ImageView
android:scaleType="center"
保持原圖的大小案疲,顯示在ImageView的中心封恰。當(dāng)原圖的size大于ImageView的size诺舔,超過部分裁剪處理低飒。
android:scaleType="centerCrop"
以填滿整個(gè)ImageView為目的懂盐,將原圖的中心對準(zhǔn)ImageView的中心,等比例放大原圖崭倘,直到填滿ImageView為止(指的是ImageView的寬和高都要填滿)类垫,原圖超過ImageView的部分作裁剪處理。
android:scaleType="centerInside"
以原圖完全顯示為目的悉患,將圖片的內(nèi)容完整居中顯示,通過按比例縮小原圖的size寬(高)等于或小于ImageView的寬(高)售躁。如果原圖的size本身就小于ImageView的size陪捷,則原圖的size不作任何處理,居中顯示在ImageView啡直。
android:scaleType="matrix"
不改變原圖的大小,從ImageView的左上角開始繪制原圖撮执,原圖超過ImageView的部分作裁剪處理舷丹。
android:scaleType="fitCenter"
把原圖按比例擴(kuò)大或縮小到ImageView的ImageView的高度,居中顯示
android:scaleType="fitEnd"
把原圖按比例擴(kuò)大(縮小)到ImageView的高度谋币,顯示在ImageView的下部分位置
android:scaleType="fitStart"
把原圖按比例擴(kuò)大(縮小)到ImageView的高度装获,顯示在ImageView的上部分位置
android:scaleType="fitXY"
把原圖按照指定的大小在View中顯示瑞信,拉伸顯示圖片,不保持原比例精肃,填滿ImageView
四司抱、Button
五黎烈、ProgressBar
六、CheckBox
七资溃、AlertDialog
AlertDialog.Builder dialog = new AlertDialog.Builder(MainActivity.this);
dialog.setTitle("This is Dialog");
dialog.setMessage("Something important.");
dialog.setCancelable(false);
dialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
dialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
dialog.show();
八溶锭、ProgressDialog
ProgressDialog progressDialog = new ProgressDialog(MainActivity.this);
progressDialog.setTitle("This is ProgressDialog");
progressDialog.setMessage("Loading...");
progressDialog.setCancelable(true);
progressDialog.show();
九符隙、ScrollView
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/response"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</ScrollView>
</LinearLayout>