移动应用的界面配置-手机银行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>
相关推荐
开开心心就好3 小时前
免费PDF处理软件,支持多种操作
运维·服务器·前端·spring boot·智能手机·pdf·电脑
哲科软件15 小时前
从“电话催维修“到“手机看进度“——售后服务系统开发如何重构客户体验
大数据·智能手机·重构
雾江流2 天前
LinkAndroid 0.6.0 | 支持多部手机同时连接的全能手机投屏工具
智能手机·软件工程
feiyangqingyun2 天前
全网唯一/Qt结合ffmpeg实现手机端采集摄像头推流到rtsp或rtmp/可切换前置后置摄像头/指定分辨率帧率
qt·智能手机·ffmpeg
云云32113 天前
亚矩云手机赋能Vinted矩阵运营:破解二手电商多账号与本地化困局
网络·人工智能·智能手机·矩阵·自动化
东风西巷13 天前
MolyCamCCD复古胶片相机:复古质感,时尚出片
android·数码相机·智能手机·软件需求
开开心心就好14 天前
高效批量转换Word到PDF的方法
javascript·安全·智能手机·pdf·word·objective-c·lisp
云云32114 天前
Subway Surfers Blast × 亚矩阵云手机:手游矩阵运营的终极变现方案
大数据·人工智能·线性代数·智能手机·矩阵·架构
东风西巷14 天前
有道翻译官手机版:智能翻译,随行助手
android·智能手机·软件需求
openKylin14 天前
Macintosh小电脑、小手机 | openKylin最新硬件创意形态首次亮相!
智能手机·开源