 <p>Well, just searched more. Found out that I didn’t override my onMeasure method correctly. Here is my new implementation if someone stumbles upon this question:</p> <p><strong>SeatStateView.java:</strong></p> <pre><code>@Override protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec){ // Background image’s size int desiredWidth = getBackground().getIntrinsicWidth(); int desiredHeight = getBackground().getIntrinsicHeight(); int widthMode = MeasureSpec.getMode(widthMeasureSpec); int widthSize = MeasureSpec.getSize(widthMeasureSpec); int heightMode = MeasureSpec.getMode(heightMeasureSpec); int heightSize = MeasureSpec.getSize(heightMeasureSpec); // Final size int width, height; // Set width depending on mode if(widthMode == MeasureSpec.EXACTLY) { width = widthSize; } else if(widthMode == MeasureSpec.AT_MOST) { width = Math.min(desiredWidth, widthSize); } else { width = desiredWidth; } // Set height depending on mode if(heightMode == MeasureSpec.EXACTLY) { height = heightSize; } else if(widthMode == MeasureSpec.AT_MOST) { height = Math.min(desiredHeight, heightSize); } else { height = desiredHeight; } // Finally, set dimension setMeasuredDimension(width, height); } </code></pre> <p>For details, check this page: <a href="http://stackoverflow.com/questions/12266899/onmeasure-custom-view-explanation">onMeasure custom view explanation</a>.</p> <p>Sorry for bothering you.</p>