【问题标题】:android: Use Color Array in XMLandroid:在 XML 中使用颜色数组
【发布时间】:2016-08-24 11:24:35
【问题描述】:

正如我看到的许多帖子,有办法从 XML 获取 String 数组并直接绑定到 RecyclerView 或任何其他控件,如 Spinner强>。

特别是在Android Databinding String ArrayRecylerView 绑定使用app:entries="@{@stringArray/fi} like:

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <android.support.v7.widget.RecyclerView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:entries="@{@stringArray/fi}"
        app:layoutManager="android.support.v7.widget.LinearLayoutManager"/>
</layout>

颜色数组有什么办法吗?

【问题讨论】:

    标签: android arrays xml


    【解决方案1】:

    recyclerview 中没有这样的属性。查看此答案以了解详细信息- https://stackoverflow.com/a/34276174/5439549

    【讨论】:

      猜你喜欢
      • 2020-06-14
      • 2011-04-26
      • 2011-04-15
      • 2012-04-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多