我只是一个Android初学者&尝试与ViewHolder模式RecyclerView与ViewHolder模式
与样品在制定RecyclerView:在实施代码https://guides.codepath.com/android/using-the-recyclerview#create-the-recyclerview-within-layout
:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<android.support.v7.widget.RecyclerView
android:id="@+id/rvContacts"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
是要求在res/layout/activity_users.xml中实施
我已经使用Basic A创建了项目ctivity &有文件
activity_main.xml中& content_main.xml
是activity_users.xml其他自定义文件?或默认文件? 你能告诉我它应该在哪里实现上面的代码?
以上布局是您的活动布局,只需在您的活动布局中放置回收站即可。否则使用该布局作为活动布局 –
将此代码放入主活动xml – KrishnaJ
您的意思是activity_main.xml? –