日々精進

新しく学んだことを書き留めていきます

Android StudioでPreview時に「failed to find style 'textviewstyle' in current theme」エラー

原因はアプリ独自のThemeを定義していたが、textviewstyleをその中で定義していなかったこと。 styleを一つずつ定義していくのは大変なので親Themeを指定して解決した。 styles.xmlは以下のような感じ。

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="android:Theme.Black">
        <!-- Customize your theme here. -->
    </style>

</resources>