그냥 개발자 블로그

안드로이드스튜디오 전체화면 만들기 본문

IT소식&팁

안드로이드스튜디오 전체화면 만들기

마음이파파 2015. 12. 4. 02:13

안드로이드스튜디오는 이클립스와 안드로이드 프로젝트 구조가 달라 햇갈리더군요. 

과거 전체화면 만들기 방법으로 만들경우 apk는 만들어지나 앱 설치후 구동시 에러가 나서 애 먹었네요.

V6 이상부터는 아래 방법을 사용하는것이 좋은것 같아요.





/app/src/main/res/values/style.xml


<resources>


    <!-- Base application theme. -->

    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">

        <!-- Customize your theme here. -->

        <item name="colorPrimary">@color/colorPrimary</item>

        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>

        <item name="colorAccent">@color/colorAccent</item>

        <item name="android:windowFullscreen">true</item>

    </style>


</resources>


하얀색으로 표시된 부분을 고치거나 추가하시면 타이틀바와 상태바가 나타나지 않습니다.




/app/src/main/res/layout/activity_main.xml


<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:tools="http://schemas.android.com/tools"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:padding="0dp"

    tools:context="com.playground.myapplication.MainActivity"

    >


    <WebView

        android:layout_width="match_parent"

        android:layout_height="match_parent"

        android:text="" />

</RelativeLayout>


처음 자동으로 프로젝트 생성시 상,우,하,좌 에 패딩이 16dp가 적용되어 있습니다. 이를 모두 삭제하고 패딩 전체를 0dp 로 설정해줘야 빈 공간이 생기지 않습니다.

저의 경우는 하이브리드앱을 만들기위해 웹뷰가 필요하여 웹뷰에 가로와 세로 사이즈를 match_parent로 해주었습니다.