我有以下代码:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto">
<solid android:color="#000000" />
...
</shape>
如何为'android:color="#000000"'做颜色绑定(bind)?
此可绘制对象是从绑定(bind) View 中引用的。
谢谢
最佳答案
我认为这是可行的。但是,要使用的确切技术将取决于可绘制对象中的完整代码,以及如何使用可绘制对象。
如果您查看像 Change drawable color programmatically 这样的 Android/Java 问题和 Set android shape color programmatically然后他们会给你一些想法如何实现你的效果 - 但具体使用的技术将取决于你的个人情况。
作为第一阶段,我建议使用一些代码进行原型(prototype)制作,以使颜色变化正常工作 - 然后可以轻松地将其连接到可以数据绑定(bind)的 C# View 属性。
关于android - 使用 MvvmCross 绑定(bind) android Drawable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22628819/