第一步:找到首页分到导航所在的页面 res/layout/ac.xml
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/d_10" ></androidx>
第二步:recyclerview.widget.RecyclerView 通过这个描述可以推测出使用的widget的RecyclerView,这个插件需要adapter配合,在java/你的包名/adapter/one/下找到HomeHotGameAdapter
第三步 通过HomeHotGameAdapter文件中代码,可以看出使用了item_activity_home_hot_game_layout布局文件
//创建新View,被LayoutManager所调用
@Override
public HomeHotGameAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_activity_home_hot_game_layout, viewGroup, false);
//将创建的View注册点击事件
view.setOnClickListener(this);
return new HomeHotGameAdapter.ViewHolder(view);
}
第四步:在res/layout/下找到 item_activity_home_hot_game_layout.xml文件,即可进行修改
<com.haitianshi.hts.utils.CircleImageView
android:id="@+id/ci_head"
android:layout_width="@dimen/d_40"
android:layout_height="@dimen/d_40"
android:layout_marginTop="@dimen/d_5"
android:src="@drawable/icon_wzry" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/d_5"
android:text="N/A"
android:textColor="@color/c_666666"
android:textSize="@dimen/sp_12" />
希望通过这个解答能给大家提供一个解决类似问题的通用思路