摘要:
布局: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" 阅读全文
posted @ 2022-07-30 17:52
小白龙白龙马
阅读(44)
评论(0)
推荐(0)
摘要:
图像视图展示的图片通常位于res/drawable***目录,设置图像视图的显示图片有两种方式: (1)在XML文件中,通过属性android:src设置图片资源,属性值格式形如“@drawable/不含扩展名的图片名称”。 (2)在Java代码中,调用setImageResource方法设置图片资 阅读全文
posted @ 2022-07-30 17:27
小白龙白龙马
阅读(392)
评论(0)
推荐(0)
摘要:
按钮控件Button由TextView派生而来,它们之间的区别有: (1)Button拥有默认的按钮背景,而TextView默认无背景; (2)Button的内部文本默认居中对齐,而TextView的内部文本默认靠左对齐; (3)Button会默认将英文字母转为大写,而TextView保持原始的英文 阅读全文
posted @ 2022-07-30 15:54
小白龙白龙马
阅读(438)
评论(0)
推荐(0)
摘要:
文本显示 布局: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_par 阅读全文
posted @ 2022-07-30 14:23
小白龙白龙马
阅读(60)
评论(0)
推荐(0)
摘要:
线性布局LinearLayout 线性布局内部的各视图有两种排列方式: (1)orientation属性值为horizontal时,内部视图在水平方向从左往右排列。 (2)orientation属性值为vertical时,内部视图在垂直方向从上往下排列。 如果不指定orientation属性,则Li 阅读全文
posted @ 2022-07-30 13:49
小白龙白龙马
阅读(213)
评论(0)
推荐(0)
摘要:
设置视图的宽高: 视图宽度通过属性android:layout_width表达,视图高度通过属性android:layout_height表达,宽高的取值主要有下列三种: (1)match_parent:表示与上级视图保持一致。(2)wrap_content:表示与内容自适应。(3)以dp为单位的具 阅读全文
posted @ 2022-07-30 12:31
小白龙白龙马
阅读(317)
评论(0)
推荐(0)
摘要:
第一个页面添加一个按钮,设置按钮监听事件,并用于跳转到下个页面: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android: 阅读全文
posted @ 2022-07-30 11:27
小白龙白龙马
阅读(65)
评论(0)
推荐(0)

浙公网安备 33010602011771号