2024/4/13
今日计划:开始整主页面的动态切换页面的效果
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout 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:openDrawer="start"
android:background="@drawable/beijin">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/tablayout" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tablayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/transparent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/book_dariy"
android:isScrollContainer="false"
android:text="我的书库" />
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/dairy_"
android:text="写日记" />
<com.google.android.material.tabs.TabItem
android:id="@+id/space_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/chat_friend"
android:text="社交" />
<com.google.android.material.tabs.TabItem
android:id="@+id/space_button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/space_"
android:text="动态" />
</com.google.android.material.tabs.TabLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<RelativeLayout
android:id="@+id/relative_layout_drawer"
android:layout_width="250dp"
android:layout_height="match_parent"
android:layout_gravity="start"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/kkk"
android:scaleType="fitXY" />
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="35dp"
android:text="Hi,又见面啦"
android:textSize="30dp"
/>
<Button
android:id="@+id/button1"
android:layout_width="177dp"
android:layout_height="62dp"
android:layout_marginStart="75dp"
android:layout_marginTop="80dp"
android:background="@color/transparent"
android:text="我的昵称"
android:textSize="25dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/text" />
<ImageView
android:layout_width="65dp"
android:layout_height="65dp"
android:layout_marginStart="10dp"
android:layout_marginTop="80dp"
android:contentDescription="@string/app_name"
android:src="@drawable/name1"
app:layout_constraintBottom_toBottomOf="@id/button1" />
<Button
android:id="@+id/button2"
android:layout_width="177dp"
android:layout_height="62dp"
android:layout_marginStart="75dp"
android:layout_marginTop="180dp"
android:background="@color/transparent"
android:text="我的密码"
android:textSize="25dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/button1" />
<ImageView
android:layout_width="65dp"
android:layout_height="65dp"
android:layout_marginStart="10dp"
android:layout_marginTop="180dp"
android:contentDescription="@string/app_name"
android:src="@drawable/password_"
app:layout_constraintBottom_toBottomOf="@id/button2" />
<Button
android:id="@+id/button3"
android:layout_width="177dp"
android:layout_height="62dp"
android:layout_marginStart="75dp"
android:layout_marginTop="280dp"
android:background="@color/transparent"
android:text="我的手机号"
android:textSize="25dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/button2" />
<ImageView
android:layout_width="65dp"
android:layout_height="65dp"
android:layout_marginStart="10dp"
android:layout_marginTop="280dp"
android:contentDescription="team"
android:src="@drawable/phone_"
app:layout_constraintBottom_toBottomOf="@id/button3" />
</RelativeLayout>
</androidx.drawerlayout.widget.DrawerLayout>
存在问题:暂无

浙公网安备 33010602011771号