- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
RecyclerView
offers a convenient way to preview the layout在 Android Studio 的 Design 选项卡中:
tools:itemCount
ExpandableListView
是否有任何等价物? ?
我假设答案是“否”,因为我发现了一个不同的工具,tools:listitem
适用于 ExpandableListView
.我相信这是由其 documentation 解释的,“用于:<AdapterView>
(和子类,如 <ListView>
)”。
最佳答案
是的,你是对的。每个 tools:
属性属于不同的类。
您可以像下面这样整合这两个属性。
主要布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
tools:context=".MainActivity">
<ExpandableListView
android:id="@+id/expandableListView"
tools:listitem="@layout/sample_list_item" //notice this line
android:layout_height="match_parent"
android:layout_width="match_parent"
android:indicatorLeft="?android:attr/expandableListPreferredItemIndicatorLeft"
android:divider="@android:color/darker_gray"
android:dividerHeight="0.5dp" />
</RelativeLayout>
sample_list_item 布局:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:itemCount="3" //notice this line
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
注意显示了三个项目。
关于android - 什么是工具 :itemCount equivalent for ExpandableListView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53290502/
我对 Azure App Insights 采样有疑问。如果日志项的 itemCount 字段大于 1,是否意味着存在完全相同的请求并且已对其进行采样? 我的日志有一个请求发送此消息,其中 itemC
在 ListCollectionView , 我只是添加新的 GroupDescriptions . 但我正在寻找一种根据 ItemCount 对它们进行排序的方法的组。 所以在第一个位置我会得到最多
我已经尝试了几种不同的方法,但我无法让这个 viewpager 正常运行。我正在设置一个带有适配器的 viewpager2,但部分要求是 viewpager 可以手动滑动以及基于按钮以增加寻呼机 Vi
命名变量的正确方法是什么 int numItems; 对比 int itemCount; 或常数: public static final int MAX_NUM_ITEMS = 64; 对比 pub
很可能我的 SliverGrid 概念完全错了, 我想要做的是,UI 方面我想要 Flutter 中已经提供的可折叠 SliverAppBar。我的主要内容主体是一组来自 API 响应的图像,并且已经
RecyclerView offers a convenient way to preview the layout在 Android Studio 的 Design 选项卡中: tools:item
recyclerView 的 ItemCount 方法是: @Override public int getItemCount() { Log.e("Notification Size is
我基于 PagedListAdapter 实现了分页功能,并且我已经过检查工作正常。我尝试实现以如果 ListAdapter 项为空则显示 EmptyHolder 为特色。在调用 submitList
如果 itemcount属性与索引行数不完全匹配是个问题吗?有没有一种数字方法可以确保我拥有完整的全文索引? 更新:属性(property)fulltextcatalogproperty('datab
我如何才能获得当前的项目数量,即我的 PagingData持有?我找到的唯一解决方案是调用 shopListAdapter.itemCount但这总是返回 0。 我要做的是:获取我的 PagingAd
我正在使用 UICollectionView 和 UICollectionViewDiffableDataSource 并异步和同步获取数据以填充 View 。应用程序崩溃并显示以下消息:“由于未捕获
我正在尝试学习 C 编程,所以我尝试做一些练习。如下所示,搜索函数仅返回 1 或 -1,并且变量索引用于确定目标学生是否存在。但之后它再次被用来确定它是数组中的最后一项、中间项还是第一项。当我们已经将
我有一个 flutter 应用程序,其中使用 ListView.Builder 生成列表,其中 itemCount 是 firestore 集合中的文档数。在添加新文档之前,这可以正常工作。发生这种情
我有一个 flutter 应用程序,其中使用 ListView.Builder 生成列表,其中 itemCount 是 firestore 集合中的文档数。 当我将文档添加到集合中时,我可以通过打印看
我有错误说: "No named parameter with the name 'itemCount'. in Flutter GridView " 任何人都可以帮助解决这个错误。我是 Flutte
我有一个问题,调整我的容器的高度,我希望我的容器的高度取决于它的内容物。然而,容器几乎占据了整个屏幕(不包括应用程序栏和底部导航)。这是我制作的样本片段。。我想要我的容器的底部在我画的黑线上,如果物品
我有一个问题,调整我的容器的高度,我希望我的容器的高度取决于它的内容物。然而,容器几乎占据了整个屏幕(不包括应用程序栏和底部导航)。这是我制作的样本片段。。我想要我的容器的底部在我画的黑线上,如果物品
我正在尝试使用以下代码从 firestore 获取文档: Future getCategories() async { var firestore = Firestore.instance;
我是一名优秀的程序员,十分优秀!