出于某種原因,項目 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 的建議
添加回答
舉報
0/150
提交
取消