【发布时间】:2016-08-24 11:24:35
【问题描述】:
正如我看到的许多帖子,有办法从 XML 获取 String 数组并直接绑定到 RecyclerView 或任何其他控件,如 Spinner强>。
特别是在Android Databinding String Array 与 RecylerView 绑定使用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>
颜色数组有什么办法吗?
【问题讨论】: