简单安卓小程序:登录界面 图片切换&移动终端软件开发课程

本文介绍如何在安卓小程序中创建登录界面,包括图片切换和UI设计。在style.xml中添加Base.解决UI显示问题。控件包括EditView、TextView、ImageView和Button。布局使用线性布局,并通过android:layout_weight分配空间。此外,讲解了EditText的改变事件监听和Button的点击事件监听。登录界面使用EditView、TextView、CheckBox和Button,通过CheckBox控制密码的显示与隐藏。
摘要由CSDN通过智能技术生成

补充说明一下,经常出现UI不显示自己的设计结果的情况。通过查阅文档,发现在style.xml中的parent中添加Base.即可很好的解决问题。
1
###1.图片切换
图片切换
####应用的控件:

  1. EditView
  2. TextView
  3. ImageView
  4. Button
    ####将图片引入
    这个步骤非常简单,只需要把所需图片复制到drawable文件夹中,如图
    111
    ####设计布局:
    很简单我们只需要它顺次排列,因此只需要用最简单的线性布局,因此在.xml文件中改写:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"//垂直线性排列
    tools:context=".MainActivity">
EditView部分
    <EditText
    android:id="@+id/editText1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

####TextView部分

    <TextView
        android:id="@+id/textView2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/easy_te
  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值