android 自学笔记

发布时间:2020-07-03 23:18:39 作者:13764987389
阅读:361
Android开发服务器,限时0元免费领! 查看>>

  今日学习了Android常用的控件

  1. TextView

    <TextView
        android:id="@+id/text_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:textSize="24sp"
        android:textColor="#00ff00"
        android:text="This is TextView" />

2.Button

<Button 
        android:id="@+id/button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Button" />

3.EditText

    <EditText 
        android:id="@+id/edit_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
		android:hint="Type something here"
		android:maxLines="2"
        />

4.ImageView

    <ImageView 
        android:id="@+id/p_w_picpath_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_launcher"
        />

5.ProgressBar

        <ProgressBar 
        android:id="@+id/progress_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style = "?android:attr/progressBarStyleHorizontal"
        android:max="100"
        />

6.AlertDialog

AlertDialog.Builder dialog = new AlertDialog.Builder(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) {
					// TODO 自动生成的方法存根
					
				}
			});
			
			dialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
				
				@Override
				public void onClick(DialogInterface arg0, int arg1) {
					// TODO 自动生成的方法存根
					
				}
			});
			dialog.show();
			

7.ProgressDialog

			ProgressDialog progressDialog = new ProgressDialog(this);
			progressDialog.setTitle("This is ProgressDialog");
			progressDialog.setMessage("Loading...");
			progressDialog.setCancelable(true);
			progressDialog.show();

常用属性可查。

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

推荐阅读:
  1. Android软硬整合技术(HAL&Framework)
  2. 3000套IOS android源码分享 7.2G UI素材

开发者交流群:

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

控件 android roi

上一篇: OSI七层与TCP/IP四层模型

下一篇:理论 - DELETE和TRUNCATE区别?

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》
开发者交流群×