Ich habe vor kurzem auf API 24 aktualisiert und jetzt habe ich ein Problem mit der Textfarbe auf meinem AppCompatSpinner in der Symbolleiste.Wie Ändern der Textfarbe auf AppCompatSpinner in Toolbar?
Hier ist, worüber ich spreche, beachten Sie, wie "Pils" ganz oben schwarz ist. Pre API 24 das war weiß. (Außerdem läuft diese APP auf einem Gerät, das API nicht auf 24 ist der Text zeigt, weiß, wie es sollte.)
Hier ist meine build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '24.0.0'
defaultConfig {
applicationId 'com.baviloworks.braumeister'
minSdkVersion 17
targetSdkVersion 24
versionCode 100
versionName '1.0.0'
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:support-v4:24.0.0'
compile 'com.android.support:design:24.0.0'
compile 'com.android.support:cardview-v7:24.0.0'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.3'
}
Hier mein style.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="windowActionBar">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="colorPrimaryDark">@color/DarkBlue</item>
<item name="colorAccent">@color/Green</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="customTabText" parent="TextAppearance.Design.Tab">
<item name="android:textSize">13sp</item>
</style>
</resources>
und hier ist die XML, wenn meine Toolbar:
<android.support.v7.widget.Toolbar
android:id="@+id/Toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/Blue"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
<android.support.v7.widget.AppCompatSpinner
android:id="@+id/Recipe_Selection_Spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:popupBackground="@drawable/spinner_rounded_corners"
android:minWidth="175dp"/>
</android.support.v7.widget.Toolbar>
Es wäre schön, wenn mir jemand in die richtige Richtung zeigen könnte!
Thanks :)
Ich habe das jetzt versucht:
cursorAdapter = new SimpleCursorAdapter(getActivity().getApplicationContext(), R.layout.custom_spinner, dbData, recipeNames, recipeTo, 0);
cursorAdapter.setDropDownViewResource(R.layout.spinner_dropdown_item);
recipeLoadSelection.setAdapter(cursorAdapter);
und das ist der Brauch Spinner:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff" />
Aber jetzt wird der Text auf allen
nicht angezeigt
Danke! klappt wunderbar – Bavilo