정답보다 해답을

[Android] EditText 선택 시 버튼이 올라오는 현상은 왜 그럴까? 본문

Android

[Android] EditText 선택 시 버튼이 올라오는 현상은 왜 그럴까?

스탑스톤 2024. 3. 12. 20:59

 

개인 프로젝트 중 오류아닌 오류를 보았다.

EditText 영역을 선택하면 가장 하단에 있는 버튼이 올라오게 되는 것

 

<androidx.appcompat.widget.AppCompatButton
    android:id="@+id/btn_register_complete_button"
    style="@style/AppButtonPrimary"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_marginStart="16dp"
    android:layout_marginEnd="16dp"
    android:layout_marginBottom="25dp"
    android:text="@string/label_register_item_button"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent" />

 

해당 버튼 코드는 다음과 같이 작성되었다.

설마 키패드가 올라오는 순간 키패드 윗부분까지를 parent값으로 인식하는 것인가? 라는 궁금증에

app:layout_constraintBottom_toBottomOf="parent"

이 코드를 

app:layout_constraintTop_toBottomOf="@id/가장 하단의 태그"

이렇게 수정했다.