Appraysal
Back to Rules
INFOAdvisoryGuideline 2.4.1Google PlayiOS & AndroidDesign

Hardcoded Frame Sizes Detected

Your code contains hardcoded frame/size values which may cause UI issues on different screen sizes, especially iPad. Use Auto Layout, size classes, or responsive sizing instead.

Quick Fix

Replace hardcoded frame values with Auto Layout constraints, SwiftUI layout modifiers, or relative sizing based on screen bounds. This ensures your UI adapts to all device sizes including iPad.

What Gets Detected

Detection Type:CODE PATTERN
Patterns detected:
/\bCGRect\s*\(\s*x:\s*\d+(?:\.\d+)?\s*,\s*y:\s*\d+(?:\.\d+)?\s*,\s*width:\s*\d{2,4}(?:\.\d+)?\s*,\s*height:\s*\d{2,4}(?:\.\d+)?/i/\bframe\s*=\s*CGRect\s*\(/i/\bCGSize\s*\(\s*width:\s*\d{2,4}(?:\.\d+)?\s*,\s*height:\s*\d{2,4}(?:\.\d+)?\s*\)/i/\.frame\s*\(\s*(?:width|height)\s*:\s*\d{2,4}(?:\.\d+)?/i/\.frame\s*\(\s*width\s*:\s*\d{2,4}(?:\.\d+)?\s*,\s*height\s*:\s*\d{2,4}(?:\.\d+)?/i/\bNSLayoutConstraint\b[\s\S]{0,120}\bconstant\s*:\s*\d{2,4}\b/i/\bUIScreen\.main\.bounds\.(width|height)\s*(==|>=|<=)\s*(320|375|390|414|428|768|810|820|834|1024|1112|1194|1366)\b/i/\b(screenWidth|screenHeight|deviceWidth|deviceHeight)\s*(==|>=|<=)\s*(320|375|390|414|428|768|810|820|834|1024|1112|1194|1366)\b/i/\b(width|height)\s*:\s*(320|375|390|414|428|568|667|736|812|844|896|926|768|810|820|834|1024|1112|1194|1366)\b/i/\b(width|height)\s*:\s*([3-9]\d{2}|1\d{3})\b/i/layout_(width|height)\s*=\s*"(3\d{2}|[4-9]\d{2}|1\d{3})dp"/i/android:layout_(width|height)\s*=\s*"(3\d{2}|[4-9]\d{2}|1\d{3})dp"/i/Modifier\.(width|height|size)\s*\(\s*(3\d{2}|[4-9]\d{2}|1\d{3})\.dp\s*\)/i/\bSizedBox\s*\(\s*(width|height)\s*:\s*(3\d{2}|[4-9]\d{2}|1\d{3})\b/i/\bLayoutParams\s*\(\s*\d{3,4}/i/\bCGRectMake\s*\(\s*\d+/i

Check Your App

Scan your project to see if this rule affects your app

Run Free Scan