RecyclerView 获取指定位置item的view并获取view的子控件


@Override
protected void onResume() {
    super.onResume();
    new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
            View view = mLayoutManager.findViewByPosition(2);	//2为recyclerView中item位置,
		//mLayoutManager为recyclre的布局管理器
LinearLayout layout = (LinearLayout)view ; //获取布局中任意控件对象 TextView status = (TextView) layout.findViewById(R.id. txt_status) ; System. out.println( "91---------------------"+status.getText()) ; } } , 300) ; }

你可能感兴趣的:(android)