为了账号安全,请及时绑定邮箱和手机立即绑定

单击时展开/折叠不正确的 CardView

单击时展开/折叠不正确的 CardView

慕容708150 2021-09-29 13:35:21
出于某种原因,项目 C CardView是唯一一个动画 - 即使在单击项目 B或项目 A 时 CardView也是如此。在法国元音 CardView,因为它工作正常不适用。有谁知道如何解决这个问题,以便正确的 CardView 动画?GridView 的 GridViewCustom 类public class GridViewCustom extends GridView {    public GridViewCustom(Context context) {        super(context);    }    public GridViewCustom(Context context, AttributeSet attrs) {        super(context, attrs);    }    public GridViewCustom(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);    }    @Override    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {        int heightSpec;        if (getLayoutParams().height == AbsListView.LayoutParams.WRAP_CONTENT) {            heightSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);        }        else {            //Any other height should be respected as is.            heightSpec = heightMeasureSpec;        }        super.onMeasure(widthMeasureSpec, heightSpec);    }}基于 Nikhil 的建议
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 239 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信