移动应用的界面配置-手机银行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>
相关推荐
美团骑手阿豪2 天前
Unity适配 安卓15+三键导航模式下的 底部UI被遮挡
android·智能手机
shughui2 天前
Android SDK 下载、安装与配置(详细图文附安装包,适配Appium+Python自动化)
android·python·appium·android-studio·android sdk
一尘之中2 天前
手机开源系统(LineageOS/PostmarketOS实战)
智能手机·开源·ai写作
千里马学框架2 天前
疑难ANR面试题:crash导致ANR深入剖析
android·智能手机·framework·perfetto·性能·anr·小米汽车
2501_919219043 天前
画册设计尺寸在不同设备(手机/平板)显示差异如何处理?
python·智能手机·电脑
深圳博达智联3 天前
博达智联供水4G控制器方案:厂家集中管控,终端用户手机远程控,运维成本降一半
物联网·智能手机·人机交互
MoonPointer-Byte3 天前
【Python爬虫实战】用 Flet 把爬虫做成手机 App
爬虫·python·智能手机
LOnghas12113 天前
YOLO11-ContextGuideFPN_手机玻璃盖板裂缝缺陷检测技术详解
智能手机
ii_best3 天前
按键精灵安卓/IOS手机助手 × 手机按键 App:1 分钟搞定设备连接(超详细教程)
android·ios·智能手机·自动化·编辑器
Dev7z4 天前
基于 YOLO 的课堂手机使用行为智能检测系统实践
yolo·目标跟踪·智能手机