스낵바 네비게이션바 안으로 숨는 문제 해결하는 방법 알려주세요.
조회수 815회
안녕하세요. 해쉬코드 회원님들 제가 스낵바를 사용하고자하는데 스낵바가 네비게이션바(하단바) 안 쪽에 숨어 버리는 버그가 나왔습니다. 검색해봐도 딱히 해결되는 소스가 없어서 질문드립니다.
Snackbar.make(getWindow().getDecorView().getRootView(), "로그인",Snackbar.LENGTH_LONG).show();
스낵바는 기본 API를 이용해서 활용했습니다.
<!-- 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:windowTranslucentStatus">true</item>
</style>
스타일은 기존 것에다가 android:windowTranslucentStatus를 true로 추가했습니다.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="@color/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
android:elevation="4dp">
</android.support.v7.widget.Toolbar>
툴바 XML 소스는 이렇게 꾸몄습니다. 그리고 그것을 include하는 main.xml 코드입니다.
<?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=".MainActivity">
<include
layout="@layout/toolbar"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="테스트"/>
</LinearLayout>
</LinearLayout>
문제가 있는 점이 있거나 아님 해결 방법 알려주셨으면 좋겠습니다. 3시간 시간 낭비 중입니다. 차후에 스낵바를 사용할 경우가 생길까봐 테스트하는데 아래 사진과 같이 나타나네요.
-
(•́ ✖ •̀)
알 수 없는 사용자
댓글 입력