- 1、本文档共9页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
编辑框(EditText)
PAGE 9
实训(实 验) 报 告
实训(实验)项目:
编辑框(EditText)使用
实验目的:
学习编辑框相关属性
学习编辑框控件相关属性与使用
实训(实验)设计(器材、步骤、结论):
简介:
EditText视图显示了一个矩形区域,用户可以向其中输入一些文本。Layout_height属性被设置为wrap_content,这样,如果用户输入一个长的文本串,EditText的高度将随内容自动调整。
实验目的 : 简单登录界面的实现
任务1:设置EditText包含圆滑片框,片框颜色,背景颜色的背景属性
因为我们新建一个EditText而不作任何设置,默认的样式是非常难看的并且带有下划线,所以我们这次实验的重点之一是给EditText尽量完美的优化。
步骤1. drawable下创建et.xml完成以下代码。
?xml version=1.0 encoding=utf-8?
layer-list
xmlns:android=/apk/res/android
item
shape
xmlns:android=/apk/res/android
android:shape=rectangle
solid
android:color=#FFFFFF/
corners
android:bottomRightRadius=5dip
android:bottomLeftRadius=5dip
android:topLeftRadius=5dip
android:topRightRadius=5dip/
stroke
android:width=0.5px
android:color=#505050/
/shape
/item
/layer-list
步骤2.将完成的背景属性应用在我们的编辑框上。
完成代码:
EditText android:layout_width=match_parent android:layout_height=50dp android:id=@+id/editText android:paddingLeft=20dp android:hint=用户名/邮箱/手机号 android:background=@drawable/et android:layout_centerHorizontal=true android:layout_marginTop=20dp /
应用背景属性前和背景属性后,
代码解析:要知道应用背景属性的是这一行代码android:background=@drawable/et
任务 2: activity_main.xml文件代码的完成
步骤1.先建立我们用户名输入的编辑框。
代码:
EditText android:layout_width=match_parent android:layout_height=50dp android:id=@+id/editText android:paddingLeft=20dp android:hint=用户名/邮箱/手机号 android:background=@drawable/et android:layout_centerHorizontal=true android:layout_marginTop=20dp /
步骤 2.完成密码输入框代码部分。
代码:
EditText android:layout_width=match_parent android:layout_height=50dp android:id=@+id/editText2 android:background=@drawable/et android:paddingLeft=20dp android:hint=请输入密码: android:layout_below=@+id/editText android:layout_cent
您可能关注的文档
- 养猪与猪病防制 养猪与猪病防制 127田园无公害养猪场设计.doc
- 养猪与猪病防制 养猪与猪病防制 133专业户无公害养猪的设计.doc
- 遥感原理与制图 实训指导书 综合实习指导书.doc
- 药物制剂技术 固体分散体的制备及验证 固体分散体验证.docx
- 冶金制图 技能点:绘制轮承座 6.12 综合练习实训.docx
- 业务流程 中国联通3G国际漫游业务测试规范 中国联通3G国际漫游业务测试规范.doc
- 液压与气动技术及应用 液压元件识别与应用 Word学习情境1-任务1.6-1.7(2课时).doc
- 仪器分析 任务二 气相色谱仪 040202-气相色谱仪-教案.doc
- 仪器分析 知识点2:离子色谱仪的基本结构 离子色谱仪的结构电子教案.doc
- 仪器分析 知识点5:环保、化工、医药等方面的应用 环保、化工、医药等方面的应用电子教案.doc
最近下载
- LEGO乐高积木拼砌说明书42126,Ford®F-150Raptor皮卡,LEGO®Technic(年份2021)安装指南_第2份共2份.pdf
- 继电保护和安全自动装置技术规程.pdf VIP
- 2023版反假考试复习题库-上(单选题部分).pdf VIP
- (完整)2018年严重精神障碍知识技能竞赛题库.pdf VIP
- 诗词大会网络答题竞赛题库200题(含答案).pdf
- 弗洛姆的人本主义精神分析理论.ppt VIP
- 整本书阅读 会飞的教室(课件)四年级上册语文部编版.pptx
- 2024年江西司法警官职业学院单招数学考试题库及答案解析.docx
- HAIER 海尔 海尔Haier冷柜 BC BD-519HCZ 说明书.pdf
- 消防安全标志设置要求.docx VIP
文档评论(0)