以下是我正在使用的代码.我正在使用androidx.每个FAB都有一个黑色图标,即使它有白色.
mylayout.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:layout_gravity="center"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<include layout="@layout/content_geral" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="24dp"
app:backgroundTint="@color/colorPrimary"
app:srcCompat="@drawable/ic_cloud_upload"
tools:ignore="VectorDrawableCompat" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)
style.xml
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
</style>
Run Code Online (Sandbox Code Playgroud)
今天,将Android Studio从2.1.0升级到2.1.1后,在编译gradle时,错误显示:
错误:(30,13)无法解决:com.google.code.ksoap2-android:ksoap2-android:3.4.0
怎么解决?
的build.gradle:
buildscript {
repositories {
maven { url 'http://ksoap2-android.googlecode.com/svn/m2-repo' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url 'http://ksoap2-android.googlecode.com/svn/m2-repo' }
jcenter()
}
}Run Code Online (Sandbox Code Playgroud)
应用程序/的build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "com.xxx.xxx.xxxxx"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0" …Run Code Online (Sandbox Code Playgroud)