Andriod Studio编写仿微信界面

本文档指导如何使用Android Studio设计仿微信界面,包括4个tab切换效果。实验涉及创建top.xml、layout_main.xml、bottom.xml等文件,分别设置字体样式、布局组合和底部按钮样式。在MainActivity中,主要实现底部按钮点击触发中间Fragment的切换功能。
摘要由CSDN通过智能技术生成

实验要求

请根据课堂展示结果设计APP门户界面,包含4个tab切换效果。

实验内容

最终页面显示

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

需要创建的文件

在这里插入图片描述

样式文件的内容

这里只写主要的三个文件的内容,分别是topbottomlayout_main

top.xml
  • 只需要修改字体样式
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
  • 以及整个的LinearLayout的高度设置
android:layout_height="80dp"
layout_main.xml
  • 将上中下三个部分连接起来
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    >

    <include layout="@layout/top"></include>

    <FrameLayout
        android:id="@+id/td_content"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        ></FrameLayout>

    <include layout="@layout/bottom"></include>
</LinearLayout>
bottom.xml
  • 该页面设置了四个按钮的样式
  • 这是其中一个按钮的样式
 <LinearLayout
        android:id="@+id/td_tab_wexin"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:layout_weight="1"
        android:onClick="onClick"
        android:gravity="center"
        >


        <ImageButton
            android:id="@+id/imageButton1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:clickable="false"
            android:layout_weight="1"
            app:srcCompat="@drawable/message_open" /
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值