Last active
December 13, 2021 09:30
-
-
Save behdad222/3595e1c6767ad797b9b51dbcf016e9fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<ScrollView 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" | |
android:fillViewport="true"> | |
<androidx.constraintlayout.widget.ConstraintLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:padding="16dp"> | |
<ImageView | |
android:id="@+id/ivLogo" | |
android:layout_width="150dp" | |
android:layout_height="150dp" | |
android:layout_marginTop="60dp" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toTopOf="parent" | |
android:background="#ccc"/> | |
<androidx.appcompat.widget.AppCompatEditText | |
android:id="@+id/tvUsername" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="22dp" | |
android:hint="User name" | |
app:layout_constraintTop_toBottomOf="@id/ivLogo" /> | |
<androidx.appcompat.widget.AppCompatEditText | |
android:id="@+id/tvPassword" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="12dp" | |
android:hint="Password" | |
app:layout_constraintTop_toBottomOf="@+id/tvUsername" /> | |
<androidx.appcompat.widget.AppCompatButton | |
android:id="@+id/btLogin" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="16dp" | |
android:text="Login" | |
app:layout_constraintTop_toBottomOf="@+id/tvPassword" /> | |
<View | |
android:id="@+id/space" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
app:layout_constraintBottom_toTopOf="@+id/tvTerms" | |
app:layout_constraintTop_toBottomOf="@+id/btLogin" /> | |
<androidx.appcompat.widget.AppCompatTextView | |
android:id="@+id/tvTerms" | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
android:layout_marginBottom="12dp" | |
android:text="In publishing and graphic design, Lorem ipsum is a placeholder text " | |
app:layout_constraintBottom_toTopOf="@+id/tvVersion" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toStartOf="parent" /> | |
<androidx.appcompat.widget.AppCompatTextView | |
android:id="@+id/tvVersion" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginBottom="16dp" | |
android:text="Version 0.1" | |
app:layout_constraintBottom_toBottomOf="parent" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toStartOf="parent" /> | |
</androidx.constraintlayout.widget.ConstraintLayout> | |
</ScrollView> |
جالبه امروز رفتم یه مقاله خوندم درباره همین
fillViewPort
میگفت اسکرول ویو رو حتی اگر ارتفاعش رو
match_parent
هم بذاری بازم اندرید میاد اونو
wrap_content
در نظر میگیره.
و فقط همین
fillviewport
که باعث میشه فول بشه.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
اون ۲ تا المان به پایین صفحه چسبیدند.
با باز شدن کیبرد فضای سفید از بین میره و نوشتههای پایین بدون این که روی دکمه قرار بگیره میشه با اسکرول دیدشون
fillViewport و space
دو المانی هستند که برای پیاده سازی کمکمون میکنند
امکان پیاده سازی با linear layout و relative layout به همین صورت هست.