我是 kotlin 的新手,我想要一些帮助,帮助我将滚动的焦点设置在最后一个元素上,ArrayList<tags>
看看我的代码
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/RVTags"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="12dp"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/startStop"
app:layout_constraintTop_toBottomOf="@id/ui_power_range_inventory_layout"
/>
class FindTagsAdapter internal constructor(
private val ServicesList: ArrayList<Tag>
) :
RecyclerView.Adapter<FindTagViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): FindTagViewHolder {
return FindTagViewHolder(LayoutInflater.from(parent.context), parent)
}
override fun onBindViewHolder(holder: FindTagViewHolder, position: Int) {
holder.bind(ServicesList[position])
}
override fun getItemCount(): Int {
return ServicesList.size
}
}