마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

웹뷰 위에 박스 질문?

0 추천

웹뷰위에 박스 고정시켜서 그 안에 뒤로가기 버튼을 넣으려고 하는데요

뭔가 웹뷰 특성상 뭔가 이미지뷰와 겹치는 영역이 있더라구요 그래서 고정할만한게 있을까요? 적당한 크기로

 

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

    <WebView
        android:id="@+id/webview"
        android:layout_width="409dp"
        android:layout_height="729dp"
        android:layout_marginStart="1dp"
        android:layout_marginTop="1dp"
        android:layout_marginEnd="1dp"
        android:layout_marginBottom="1dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
enerigpy (2,110 포인트) 님이 2023년 2월 24일 질문

1개의 답변

0 추천
제 경우에도 비슷한 UX로 고민을 많이 했었는데요.

그냥, Back 버튼 처리가 젤로 무난한 것 같습니다. onBackPressed 에서 webview.goBack() 이런식으로 호출했던 기억이 납니다.

if (webview.canGoBack()) {

  webview.goBack();

  return;

}
mcsong (44,040 포인트) 님이 2023년 3월 1일 답변
...