移动应用的界面配置-手机银行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>
相关推荐
2501_915918413 小时前
iOS 手机抓包软件怎么选?HTTPS 调试、TCP 数据流分析与多工具组合的完整实践
android·ios·智能手机·小程序·https·uni-app·iphone
brave and determined2 天前
接口通讯学习(day05):智能手机的内部高速公路:揭秘MIPI CSI与DSI技术
学习·智能手机·软件工程·制造·csi·mipi·dsi
解压专家6663 天前
KRed阅读器用二维码重塑电子书分享体验
智能手机
wanhengidc4 天前
云手机性能如何?
运维·服务器·科技·智能手机·云计算
尊治4 天前
介绍一款手机电工仿真软件
智能手机·esim电工仿真·电工仿真软件·电工仿真·plc仿真
wanhengidc4 天前
云手机中的数据通常存储在哪里?
运维·服务器·安全·web安全·智能手机
wanhengidc4 天前
云手机中分布式存储的功能
运维·服务器·分布式·游戏·智能手机·云计算
扬道财经4 天前
2025年切膜机厂家推荐:手机切膜机,智能切膜机,自动切膜机,手机门店切膜机,源头工厂切膜机公司推荐
智能手机
wanhengidc4 天前
深度了解云手机是什么
运维·服务器·科技·智能手机·云计算
BigPomme5 天前
flutter share plus 华为/荣耀手机分享时异常
智能手机