투케이2K

255. (AndroidStudio/android/java) 웹뷰 (webview) 위에 버튼 (button) 올리기 수행 - RelativeLayout 본문

Android

255. (AndroidStudio/android/java) 웹뷰 (webview) 위에 버튼 (button) 올리기 수행 - RelativeLayout

투케이2K 2022. 1. 24. 19:40
반응형

[개발 환경 설정]

개발 툴 : AndroidStudio

개발 언어 : java

 

[소스 코드]

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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">


    <!--
    [레이아웃 설명]
    1. 사용하는 클래스 : A_ChildWebview
    2. 자식 웹뷰를 호출하는 레이아웃
     -->


    <!-- 컴포넌트 : 버튼 : 웹뷰 위에 표시 -->
    <Button
        android:id="@+id/closeBtn"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:text=""
        android:background="@drawable/icnaviclose"
        android:layout_alignParentRight="true"
        android:layout_marginRight="10dp"
        android:layout_marginTop="10dp"/>
    <!-- android:layout_alignParent 속성을 사용해서 위치 정렬 -->


    <!-- 컴포넌트 : 웹뷰 : 전체 화면 지정 -->
    <WebView
        android:id="@+id/main_webview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#343d46" />

</RelativeLayout>
 

[결과 출력]


 

반응형
Comments