Checkbox和API 23的问题 [英] Issue with Checkbox's and API 23

查看:60
本文介绍了Checkbox和API 23的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将目标平台更新为android 9.0 API 28之后,我对AppCompatCheckBox的状态及其在框和api 23中显示的颜色有疑问.

I've a problem with the status of the AppCompatCheckBox and the colors it shows in the box and the api 23 after I update the target platforms to android 9.0 API 28.

如果我将复选框初始化为true,则可以正确显示该复选框复选框初始

If I initialize my checkbox in true, it shows the check correctly checkbox initial

但是,如果我取消选中该框,它将显示带有我的原色边缘的空白框检查应该是灰色边框,白色背景.

But, if I uncheck the box it shows the blank box with the edges of my primary color check It should be gray border, white background.

并且当您检查时,这看起来很糟糕未选中应该是Boder和背景蓝色.

And when you check, this appears bad unchecked It should be boder and background blue.

我以编程方式构建了复选框

I build the checkboxes programatically

var checkBox = new AppCompatCheckBox(Context));
checkBox.checked = MyObj.Value;
AddView(checkBox);

在我的风格中,我定义颜色

And in my style I define the colors

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDarker</item>
    <item name="colorAccent">@color/colorPrimaryDarker</item>
</style>

我正在使用nuget Xamarin.Android.Support.v7.AppCompat软件包28.0.0.1和MvvmCross 6.3.0

And I'm using the package nuget Xamarin.Android.Support.v7.AppCompat version 28.0.0.1 and MvvmCross 6.3.0

这仅在具有API 23和模式发布的设备上发生,并且在调试时工作正常.

This only happens with devices with API 23 and in mode release, in debug works fine.

感谢您的帮助.

推荐答案

好几个小时后,我不得不将我的 proguard.cfg 文件更改为此:

Well, after several hours, I had to change my proguard.cfg file to this:

 -keep class com.google.android.gms.** { *; }
 -dontwarn com.google.android.gms.**
 -keep class android.support.** { *; }
 -keep class android.support.v7.widget.AppCompatCheckBox { *; }

直接放置我的appcompatcheckbox类.这是我找到的唯一解决方案.

Directly placing my appcompatcheckbox class. It was the only solution I found.

这篇关于Checkbox和API 23的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆