移动应用的界面配置-手机银行APP

  • 设置登录界面为线性布局,组件垂直居中排列
  • 设置主页为滚动模式,包括布局、添加背景图片
  • 设置按钮样式,包括形状、边框线的宽度和颜色

设置登录界面

设置界面为线性布局,组件垂直居中排列

复制代码
--android:gravity="center_vertical" 这个的意思是指 限定它里面的内容要垂直居中显示。
--android:layout_gravity="center_vertical",这个是指它的位置是相对于它父亲的垂直居中。
<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"
    tools:context=".MainActivity"
    android:orientation="vertical"
    android:background="@drawable/back"
    android:gravity="center_vertical">
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="欢迎进入手机银行"
        android:textColor="#000079"
        android:layout_marginBottom="70dp"
        android:textSize="35dp"
         />
</LinearLayout>

设置主页为滚动模式

复制代码
<RelativeLayout 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:background="@drawable/zhuye"
    tools:context=".LendActivity"
    android:id="@+id/parent"
    >
<!-- 设置表格布局的宽度为铺满,高度为自适应(随组件的高度自动调整),
排列方式为垂直排列 -->
    <TableLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">
    </TableLayout>
</RelativeLayout>

设置按钮样式

复制代码
<?xml version="1.0" encoding="utf-8"?>
<!--相当于做了一张圆角的图片,然后给button作为背景图片-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <!--设置圆角-->
    <corners android:radius="105dip" />
    <solid android:color="#E0E0E0"></solid>
    <padding
        android:bottom="3dp"
        android:left="5dp"
        android:right="5dp"
        android:top="5dp"
        />
    <!--设置边框线的宽度和颜色-->
</shape>

<Button
        android:id="@+id/btn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@xml/btn"
        android:text="登录"
        android:layout_weight="1"
        android:layout_marginRight="30dp"
        android:layout_marginBottom="10dp"></Button>
相关推荐
jack1868913 小时前
如何在华为/小米/OPPO/Vivo等手机上恢复误删除的照片文件?五种方法了解下
智能手机
wulechun16 小时前
基于多智能体协同架构的Customer-Agent开源项目深度解析与自动化客户服务实战指南
智能手机
互联网江湖18 小时前
iPhone Duo跌倒,国产折叠屏手机吃饱?
ios·智能手机·iphone
Token_w19 小时前
手机远控跑Claude Code:三个AI任务同时运行,ToDesk/UU远程/向日葵终端功能对比
人工智能·智能手机·todesk
AlanAshley19 小时前
无 SIM 卡也能打 110?手机紧急呼叫能力的软硬件技术探究
开发语言·智能手机·php
开开心心_Every1 天前
快速隐藏程序工具自定义快捷键一键切换
java·开发语言·前端·spring·智能手机·word·intellij-idea
不悔哥2 天前
开源LineageOS:旧手机刷上开源系统
嵌入式硬件·智能手机·开源
人民新视野2 天前
存储涨价推高手机均价 传音中高端产品加速落地
智能手机
reasonsummer2 天前
【办公类-04-05】20261030整理手机照片(华为手机助手导出照片到日期文件夹+批量添加四级文件夹+手动转移照片更名+更改三级文件夹合并汉字名称)
python·智能手机
lkjaslkdj2 天前
河马引力与图拉斯凯芙拉手机壳对比:一个可测试的防摔结构,两个1mm薄度内的日常量化基准
智能手机