在自定义Dialog中添加横向Recyclerview

Dialog dialog = new Dialog(this, R.style.Dialog);
dialog.setContentView(R.layout.dialog_pitch);
// 设置 recyclerview 布局方式为横
picth_rl = dialog.findViewById(R.id.pitch_rl);
LinearLayoutManager ms = new LinearLayoutManager(this);
ms.setOrientation(LinearLayoutManager.HORIZONTAL);
picth_rl.setLayoutManager(ms);
picth_rl.setAdapter(new PitchAdapter(this, seekBarMap));
final WindowManager.LayoutParams params = dialog.getWindow().getAttributes();
dialog.show();
params.width = 1200;
params.height = 800;
dialog.getWindow().setAttributes(params);

你可能感兴趣的:(在自定义Dialog中添加横向Recyclerview)