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

웹뷰가 텍스트뷰 영역을 잡아먹습니다..

0 추천

 

현재 레이아웃 디자인 상태는 이런 상태이고 아래는 코드입니다.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    android:orientation="vertical"
    tools:context="com.itam.hnc.MainActivity"
    tools:ignore="ExtraText">

  <RelativeLayout
      android:id="@+id/fragment"
      android:layout_width="294dp"
      android:layout_height="153dp"
      android:layout_x="1px"
      android:layout_y="1px"
      android:visibility="invisible"
      app:layout_behavior="@string/appbar_scrolling_view_behavior"
      tools:ignore="MissingConstraints">

  </RelativeLayout>

  <EditText
      android:id="@+id/textView"
      android:layout_width="fill_parent"
      android:layout_height="match_parent"
      android:layout_weight="1"
      android:text="테스트용 텍스트뷰"
      android:textAlignment="center"
      android:textColor="@color/design_default_color_on_secondary"
      android:textSize="36sp"
      tools:ignore="MissingConstraints" />

  <WebView
      android:id="@+id/webView"
      android:layout_width="match_parent"
      android:layout_height="527dp"
      tools:ignore="MissingConstraints"></WebView>

</LinearLayout>

이러한상태로 짜놧는데 앱을 실행시키면 아래 결과처럼 출력이 됩니다.

 

 

이런씩으로 레이아웃 디자인쪽에선 리니어레이아웃을 넣어서 영역을 구분지었다고 생각했는데

 

막상 실행해보면 원했던 결과가 안나오고 저런씩으로 웹뷰의 영역에 텍스트뷰가 들어가버립니다.

 

색깔도 텍스트컬러를 검정색으로 지정한거같은데 실적용은 하얀색으로 되어있구요...

 

웹뷰랑 텍스트뷰 영역을 따로 구분지어서 사용하고 싶은데 어떻게 해야하나요..

qeruzxop (120 포인트) 님이 2020년 11월 18일 질문
qeruzxop님이 2020년 11월 18일 수정

1개의 답변

0 추천
리니어 레이아웃 말고 컨스트레인트 레이아웃쓰세여

리니어라서 웹뷰랑 겹친거에요
익명사용자 님이 2020년 11월 19일 답변
...