我需要一张底片没有占据平板电脑的所有宽度。但它忽略layout_width
了 xml 中的属性。我怎样才能做到?我的底片类:
public class DetailsFragment extends BottomSheetDialogFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
//Create fragment root view
View view = inflater.inflate(R.layout.fragment_details, container, false);
//Set toolbar
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
Drawable icClose = VectorDrawable.getDrawable(getContext(), R.drawable.ic_close_white_24dp);
toolbar.setNavigationIcon(icClose);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dismiss();
}
});
toolbar.inflateMenu(R.menu.details);
RecyclerView rvContent = (RecyclerView) view.findViewById(R.id.rvContent);
FullExpandedListManager lm = new FullExpandedListManager(getContext());
rvContent.setLayoutManager(lm);
rvContent.setHasFixedSize(true);
rvContent.setAdapter(mAdapter);
return view;
}
}