在Android中,如何以编程方式在自定义小吃栏中设置高度?

时间:2018-05-17 11:46:06

标签: android

Snackbar snackbar = Snackbar.make(activityChefProfileBinding.coordinatorLayout, "", Snackbar.LENGTH_INDEFINITE);
        Snackbar.SnackbarLayout layout = (Snackbar.SnackbarLayout) snackbar.getView();
        TextView textView = layout.findViewById(android.support.design.R.id.snackbar_text);
        textView.setVisibility(View.INVISIBLE);
        LayoutInflater inflater = LayoutInflater.from(this);
        View snackView = inflater.inflate(R.layout.view_cart, null);
        tvItems = snackView.findViewById(R.id.tv_item);
        tvItemamount = snackView.findViewById(R.id.tv_amount);
        layout.setPadding(0, 0, 0, 0);
        layout.addView(snackView, 0);

0 个答案:

没有答案