亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

布局從屏幕的頂部到底部

布局從屏幕的頂部到底部

慕沐林林 2023-05-17 17:52:39
我有一個屏幕,其中有一個操作欄,然后是一本書的標題和章節本身。問題是,章節從上到下,標題被截斷。章節文本還與頂部的應用欄和底部的底部導航視圖重疊。請幫忙內容主頁<?xml version="1.0" encoding="utf-8"?><androidx.constraintlayout.widget.ConstraintLayout 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"    app:layout_behavior="@string/appbar_scrolling_view_behavior"    tools:context=".activities.HomeActivity"    tools:showIn="@layout/activity_home">    <FrameLayout        android:id="@+id/frameLayoutHome"        android:layout_width="match_parent"        android:layout_height="match_parent">    </FrameLayout></androidx.constraintlayout.widget.ConstraintLayout>活動之家<?xml version="1.0" encoding="utf-8"?><androidx.constraintlayout.widget.ConstraintLayout 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=".activities.HomeActivity">    <androidx.appcompat.widget.Toolbar        android:id="@+id/toolbar"        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:background="?attr/colorPrimary"        app:layout_constraintEnd_toEndOf="parent"        app:layout_constraintStart_toStartOf="parent"        app:layout_constraintTop_toTopOf="parent"        app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /></androidx.constraintlayout.widget.ConstraintLayout>
查看完整描述

1 回答

?
白衣非少年

TA貢獻1155條經驗 獲得超0個贊

試試這個作為 activity_home 布局:


<?xml version="1.0" encoding="utf-8"?>

<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"

tools:context=".HomeActivity">


<LinearLayout

    android:id="@+id/liner_layout"

    android:orientation="vertical"

    android:layout_height="match_parent"

    android:layout_width="match_parent"

    >

    <androidx.appcompat.widget.Toolbar

        android:id="@+id/toolbar"

        android:layout_width="match_parent"

        android:layout_height="?attr/actionBarSize"

        android:background="@color/colorPrimary"

        app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />


    <include

        android:id="@+id/include"

        layout="@layout/content_home"

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        app:layout_behavior="@string/appbar_scrolling_view_behavior"/>


</LinearLayout>


<com.google.android.material.bottomnavigation.BottomNavigationView

    android:id="@+id/bottomNavigationView"

    android:layout_width="match_parent"

    android:layout_height="wrap_content"

    app:menu="@menu/nav_menu"

    android:layout_alignParentBottom="true" />

保持 content_home 布局不變。


查看完整回答
反對 回復 2023-05-17
  • 1 回答
  • 0 關注
  • 133 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號