카테고리 없음

[기계적 인조 인간] 주어진 이름과 일치하는 리소스가 없습니다 ( '@ style / AppTheme'값이있는 'theme')

필살기쓰세요 2021. 1. 23. 11:55

styles.xml이름이 " AppTheme"인 스타일이 없습니다 .

예 :

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- This means your Activity will be using the Light theme with no ActionBar -->
    <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/primary</item> <!-- This is the primary color of your app, it is used for the ActionBar/Toolbar for example. -->
            <item name="colorPrimaryDark">@color/primary_dark</item> <!-- Color of Status bar on API 21+ -->
                <item name="colorAccent">@color/accent</item> <--This is the accent color, used for FloatingActionBar and other things like the EditText divider -->
                </style>
                

이제 "무엇이"인지 궁금 할 것입니다 @color/primary( 그렇지 않으면 현재 받고있는 오류가 무엇인지 알 수 없습니다 ).

당신의 이동 colors.xml( res>values>colors.xml)와 정의 primary, primary_dark그리고 accent당신이 원하는 색상. ( 좋은 재료 색상을 선택하므로이 사이트 를 사용하는 것이 좋습니다 ) :

<color name="primary"><!-- Your color --></color>
<color name="primary_dark"><!-- Your color --></color>
<color name="acent"><!-- Your color --></color>

대체 기억 <!-- Your color -->원하는 색상 (예 #3367d6)

다음은 각 속성의 기능을 설명하는 이미지입니다.

영상



출처
https://stackoverflow.com/questions/39917123