移动应用的界面配置-手机银行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>
相关推荐
yangmu32037 小时前
手机传感器原件入门:从像素点到空间感知
智能手机
Anhty1 天前
2026最新免费手机音频处理工具 !!
android·功能测试·ios·智能手机·音视频
开开心心就好1 天前
视频里的图片怎么提取?双击一下就导出
java·前端·人工智能·spring·智能手机·intellij-idea·excel
loulanyue_2 天前
Qwen Intelligence手机智能底座:读阿里副总裁许主洪2026云栖演讲
人工智能·智能手机·移动端
开开心心就好3 天前
本地文件搜索工具推荐,占用小速度还快
智能手机·ffmpeg·ocr·word·音视频·网络攻击模型·安全架构
开开心心就好3 天前
视频压缩工具推荐,画质效果很能打
智能手机·ffmpeg·ocr·word·排序算法·音视频·散列表
开开心心就好4 天前
视频压缩工具推荐,绿色版免安装双击即用
java·前端·人工智能·spring·智能手机·intellij-idea·excel
老李IT笔记4 天前
从备份恢复会把管理状态带回来吗:iOS 27 之后答案变了|MDM.Plus
ios·智能手机
DP DPharness5 天前
StudyMate 从安装到第一节课的完整操作路径
人工智能·websocket·网络协议·智能手机·dpharness
DP DPharness6 天前
手机连不上 DSH 时的排错顺序:从 401 到 WebSocket 放行
websocket·网络协议·智能手机