{"id":16688150,"url":"https://github.com/skywinder/scrollviewambigous","last_synced_at":"2025-10-07T02:08:28.601Z","repository":{"id":21628153,"uuid":"24948682","full_name":"skywinder/scrollViewAmbigous","owner":"skywinder","description":"Example for my question on SO","archived":false,"fork":false,"pushed_at":"2015-08-14T04:55:08.000Z","size":189,"stargazers_count":14,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T00:36:26.710Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://stackoverflow.com/questions/26261659/uiscrollview-centered-view-ambigous-scrollable-content-size-many-iphone-si","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skywinder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-08T16:03:18.000Z","updated_at":"2022-04-29T03:45:33.000Z","dependencies_parsed_at":"2022-08-21T20:01:01.166Z","dependency_job_id":null,"html_url":"https://github.com/skywinder/scrollViewAmbigous","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/skywinder/scrollViewAmbigous","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywinder%2FscrollViewAmbigous","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywinder%2FscrollViewAmbigous/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywinder%2FscrollViewAmbigous/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywinder%2FscrollViewAmbigous/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skywinder","download_url":"https://codeload.github.com/skywinder/scrollViewAmbigous/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywinder%2FscrollViewAmbigous/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266210841,"owners_count":23893337,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T15:27:03.521Z","updated_at":"2025-10-07T02:08:23.569Z","avatar_url":"https://github.com/skywinder.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"ScrollViewAmbigous Example\n==================\nExample for my question on SO:\n[UIScrollView + Centered View + Ambigous Scrollable Content Size + many iPhone sizes](http://stackoverflow.com/questions/26261659/uiscrollview-centered-view-ambigous-scrollable-content-size-many-iphone-si)\n\nThe initial state, with existing problems: 0a8bf35\n\nAnd resolved `Has ambiguous scrollable content width` and `Has ambiguous scrollable content height` **annoying warnings** : 3b3e874\n\n\nSo, here is the initial state for simplest case:\n==================\n\n1. scrollView with 0 constraints to all edges\n2. Button centered Horizontal and Vertical with fixed Width and Height\n3. And, of course `Has ambiguous scrollable content width` and `Has ambiguous scrollable content height` **annoying warnings**.\n\n![1](http://i.imgur.com/d5Fgmzg.png)\n\nAll, that we have to do is:\n==================\n\n- Add 2 additional constraints, for example \"0\" for trailing and/or bottom space for our view (in my case - UIButton)\n\n**Important:** you have to add **trailing and/or bottom** constraints. Not \"leading and top\" - it's not works!\n\n![2](http://i.imgur.com/7yEMQ7J.png)\n\n\nYou can check it in my example project, that demonstrating how to fix this issue: [**ScrollViewAmbigous**](https://github.com/skywinder/scrollViewAmbigous)\n\n**P.S.**\n\nI don't know why it works and how Xcode detect which constraint is more prioritised (because I'm not set priority for these constraints explicity), but I'll be thankful if someone explain, why it works.\n\nAligning multiple elements?\n==================\nWhen you want to align multiple elements, say three button in one vertical line, you'll have to set the above said additional constraints to the ***bottom most*** element. (example included)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskywinder%2Fscrollviewambigous","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskywinder%2Fscrollviewambigous","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskywinder%2Fscrollviewambigous/lists"}