2022寒假家庭记账本开发记录04
本篇是2022寒假家庭记账本开发记录04,本篇通过B站up主——写BUG的狐狸,来学习制作简约家庭记账本。如下是我今日的开发进程:
今天我绘制了记账本程序中的记录页面布局绘制:
首先我先建立了一个空的activity命名为RecordActivity,然后导入包<com.google.android.material>做出滑动页面的效果
其代码如下:
<?xml version="1.0" encoding="utf-8"?>
<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"
android:orientation="vertical"
android:background="@color/grey_f3f3f3">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp">
<ImageView
android:id="@+id/record_iv_back"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@mipmap/ih_error"
android:layout_marginLeft="10dp"/>
<com.google.android.material.tabs.TabLayout
android:id="@+id/record_tabs"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
app:tabGravity="center"
app:tabMode="fixed"
app:tabTextColor="@color/grey_7D7D7D"
app:tabSelectedTextColor="@color/black"
app:tabIndicatorColor="@color/black"/>
</RelativeLayout>
<androidx.viewpager.widget.ViewPager
android:id="@+id/record_vp"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>