Ich habe einen Konverter, der nur im Debug-Modus funktioniert. Wenn ich ein Release-APK erzeuge, funktioniert es nicht mehr.ColorStateList Converter funktioniert nur im Debug-Modus
Hier ist mein Code:
public class CardapioImageColorConverter : MvxValueConverter<bool, ColorStateList>
{
private static Activity Activity => Mvx.Resolve<IMvxAndroidCurrentTopActivity>().Activity;
protected override ColorStateList Convert(bool value, Type targetType, object parameter, CultureInfo culture)
{
ColorStateList color;
if (value)
color = Activity.Resources.GetColorStateList(Resource.Color.cor1,Activity.Theme);
else
color = Activity.Resources.GetColorStateList(Resource.Color.white, Activity.Theme);
return color;
}
}
Und mein axml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="70dp"
android:layout_height="70dp">
<Mvx.MvxImageView
android:id="@+id/imageView"
android:layout_weight="1"
android:tint="@color/white"
android:layout_width="match_parent"
android:layout_height="match_parent"
local:MvxBind="ImageUrl Icone;ImageTintList CardapioImageColor(Selecionado);"
android:layout_gravity="center" />
<TextView
local:MvxBind="Text Nome; TextColor CardapioTextColor(Selecionado);"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/cor1"
android:textSize="11dp"
android:layout_weight="1.9"
android:text="@string/lista_espera"
android:gravity="center"
android:layout_marginBottom="@dimen/margin_tiny"
android:layout_marginTop="@dimen/margin_tiny" />
</LinearLayout>
Es funktioniert perfekt im Debug-Modus. Hast du eine Ahnung, warum es passiert?
Verwenden Sie eine Lib von Drittanbietern für 'Mvx.MvxImageView'? –
Im Debug-Modus versuchen, den Linker zu aktivieren, erhalten Sie dann Fehler? – Cheesebaron
Ich verwende nur SDK Assemblies, beide Fälle. DeBug und Freigabe. –