首先我们介绍下AndroidStudio下app中各模块的功能
app:类似于java中的工程
AndroidManifest:设置权限
res下包括三个模块:1.图片 2.布局文件 3.值数据(长度,颜色,样式)
TextView:文本框
layout_width(宽) layout_parent(高)
match_parent:匹配父元素
wrap_content:匹配内容
数值:dp dip
注:大小的单位是sp 宽高的单位是dp
文本:android:text
字号:textSize
字体颜色:textColor
背景:backgroud
链接:autoLink map email phone web
链接允许被点击:linksClicjable
省略:ellipsize start middle end marquee
跑马灯:ellipsize="marquee"
singleLine=true
focusable=true
focusableTouchMode=true
图片视图
ImageViwe
src
scaleType
输入框:
EditText
hint:提示信息
inputType: textPassword:密码
editable:是否可编辑
按钮
Button
注:当设置背景颜色,文本时最好不要直接在TextView中设置,可以在values下的各功能中设置,设置好了再引用到TextView中。