安卓家庭记账本开发笔记3(补1月27日)

czf / 2024-02-15 / 原文

记录页面的编写

添加了material依赖,完成了基本页面的编写

代码如下:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey0"
android:orientation="vertical">
<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_marginStart="10dp"/>
<com.google.android.material.tabs.TabLayout
android:id="@+id/record_tabs"
android:layout_width="110dp"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
app:tabGravity="center"
app:tabMode="fixed"
app:tabTextColor="@color/grey1"
app:tabSelectedTextColor="@color/black"
app:tabIndicatorColor="@color/black"
/>

</RelativeLayout>

<androidx.viewpager2.widget.ViewPager2
android:id="@+id/record_vp"
android:layout_width="match_parent"
android:layout_height="match_parent"/>


</LinearLayout>