私はfabで他のプロジェクトにフローティングアクションボタンを実装してカスタマイズしても問題ありません。しかし今度は、私のXMLレイアウトでfabオブジェクトを作成すると、エラーが表示されます。混乱していると、そのタグの一部を削除しようとしました。アンドロイド:backgroundTintタグを指定すると、エラーが表示されることがわかりました。ここで背景色の浮動アクションボタンでエラーが発生する
コードです:ここでは
<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:fabSize="mini"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:src="@drawable/ic_action_fab"
android:backgroundTint="#2196F3"
android:layout_margin="12dp"/>
は私のビルドです:
compileSdkVersion 25
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.xxxx.xxxx"
minSdkVersion 10
targetSdkVersion 23
versionCode 1
versionName "2.0.4"
}
私はまた、GoogleのデザインのGradleを追加しました。
エラー:できるだけ早く私はアンドロイド取り除くよう
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxxx.xxxx/com.xxxx.xxxx.HomeActivity}: android.view.InflateException: Binary XML file line #141: Binary XML file line #141: Error inflating class android.support.design.widget.FloatingActionButton
:backgroundtintタグを、エラーがなくなっています。なぜこれが起こっているのか?