第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

如何消除 Android 應(yīng)用程序頂部出現(xiàn)的額外間距?

如何消除 Android 應(yīng)用程序頂部出現(xiàn)的額外間距?

慕森卡 2023-08-09 16:07:49
我正在為我的一門大學(xué)課程構(gòu)建 Android 應(yīng)用程序的主頁。我的小組正在使用 Android Studio。我已經(jīng)有了原來的布局,但我在頂部有一個隨機的額外空間,上面寫著“歡迎”。我不知道如何擺脫頂部的隨機間距,它正在將我的其余對象向下推(報告列表在導(dǎo)航欄下方消失)這是我的fragment_home.xml<?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"    android:layout_width="match_parent"    android:layout_height="match_parent">    <EditText        android:id="@+id/editText"        android:layout_width="365dp"        android:layout_height="wrap_content"        android:text="@string/home_welcome"        android:textAlignment="center"        android:textSize="20pt"        app:layout_constraintBottom_toTopOf="@+id/text_appts"        app:layout_constraintEnd_toEndOf="parent"        app:layout_constraintStart_toStartOf="parent"        app:layout_constraintTop_toTopOf="parent" />    <EditText        android:id="@+id/text_appts"        android:layout_width="365dp"        android:layout_height="55dp"        android:ems="10"        android:text="@string/title_appointments"        android:textSize="14pt"        app:layout_constraintBottom_toTopOf="@+id/recycler_appts"        app:layout_constraintEnd_toEndOf="parent"        app:layout_constraintStart_toStartOf="parent"        app:layout_constraintTop_toBottomOf="@+id/editText" />    <androidx.recyclerview.widget.RecyclerView        android:id="@+id/recycler_appts"        android:layout_width="360dp"        android:layout_height="125dp"        app:layout_constraintBottom_toTopOf="@+id/text_chats"        app:layout_constraintEnd_toEndOf="parent"        app:layout_constraintHorizontal_bias="0.484"        app:layout_constraintStart_toStartOf="parent"        app:layout_constraintTop_toBottomOf="@+id/text_appts"        app:layout_constraintVertical_bias="0.226" /></androidx.constraintlayout.widget.ConstraintLayout>
查看完整描述

2 回答

?
幕布斯6054654

TA貢獻(xiàn)1876條經(jīng)驗 獲得超7個贊

在您的activity_main.xml文件中,嘗試刪除android:paddingTop="?attr/actionBarSize"ConstraintLayout 中的行,因為沒有 actionBar。



查看完整回答
反對 回復(fù) 2023-08-09
?
嚕嚕噠

TA貢獻(xiàn)1784條經(jīng)驗 獲得超7個贊

在您的activity_main.xml中將'fragment'(nav_host_fragment)layout_width和layout_height更改為0dp。這是使用約束的正確形式。

 <fragment
    android:id="@+id/nav_host_fragment"
    android:name="androidx.navigation.fragment.NavHostFragment"
    android:layout_width="0dp"
    android:layout_height="0dp"
    app:defaultNavHost="true"
    app:layout_constraintBottom_toTopOf="@id/nav_view"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:navGraph="@navigation/mobile_navigation" />


查看完整回答
反對 回復(fù) 2023-08-09
  • 2 回答
  • 0 關(guān)注
  • 185 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號