![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
安卓
啊远~
这个作者很懒,什么都没留下…
展开
-
Android学习笔记(1)
AlertDialog and ProgressDialog AlertDialog and ProgressDialog 简单代码: AlertDialog.Builder dialog= new AlertDialog.Builder(MainActivity.this); dialog.setTitle("!!!!!!!!"); ...原创 2019-08-27 21:28:20 · 195 阅读 · 0 评论 -
安卓学习笔记(2)----LinearLayout
LinearLayout orientation属性 horizontal和vertical:LinearLayout中的控件水平排列,设置成还属性后,内部控件的宽度属性不能再设为match_parent,否则它将会将整个水平控件占满,同道理LinearLayout的排列方向是vertical,内部控件就不能将高度指定为match_parent。 示例效果如图: layout_gravity属性...原创 2019-08-29 13:46:15 · 233 阅读 · 0 评论 -
安卓学习笔记(3)------RelativeLayout
RelativeLayout RelativeLayout又称作相对布局,也是一种非常常用的布局。和LinearLayout的排列规则不同,RelativeLayout显得更随意一下,它可以通过相对定位的方式让控件出现在布局的任何位置。 以下为部分示例代码及示例样式: button1中:layout_alignParentLeft和layout_alignParentTop属性用于设置butt...原创 2019-08-29 14:25:38 · 207 阅读 · 0 评论 -
安卓学习笔记(4)——引入布局
引入布局 这里编写一个顶部小布局,代码和界面如下: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@mip...原创 2019-08-29 22:24:46 · 225 阅读 · 0 评论 -
安卓学习笔记(5)——自定义控件
自定义控件 使用自定义控件时,无需重写事件,只需在自定义控件里设好监听器,写好触发事件即可。这样可以解决编写重复布局代码的问题。 根据上一篇《引入布局》,已创建好一个顶部布局“title”,接下来需要做的是创建一个TitleLayout类继承LinearLayout,让它成为我们自定义的标题栏控件,代码如下: 首先重写LinearLayout中带有两个参数的构造函数,在布局中引入TitleLay...原创 2019-08-31 12:49:45 · 191 阅读 · 0 评论