0
を拡張したときに、私はカスタムクラスを作成し、それは私が エラーカスタムクラスがFloatingActionButton
customFAB cFab = new customFAB(getApplicationContext);
MainActivity
からこのクラスを呼び出すしかし、私はYou need to use a Theme.AppCompat theme (or descendant) with the design library.
このエラーが出るFloatingActionButton
public class customFAB extends FloatingActionButton
{
public customFAB(Context context)
{
super(context);
}
}
を拡張私のstyle.xml
は
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
テーマはTheme.AppCompat
です。だから何が問題なの?
ありがとうございました。
ですか? –
@JuliánMartínezno、MainActivtyはAppCompatActivityを拡張します。 – user4757345