Unity: Button spacing differs at different screen resolutions
In my game (Unity 2017.3.1f1) I'm using a ScrollView that's filled with buttons at runtime.
At 1080p:

And at 1440p:

The blue dots show the constraints of the Content, the whole thing (including the grey part below) makes up the Scroll View. No matter how big/small I make the Content, the border doesn't vanish at 1440p but is instead resized with the Content.
- The width of the ScrollView is set through a surrounding panel
- The buttons all use the same pefab (Inspector: click) - 1st image below
- The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click) - 2nd image below


As you can see in the last screenshot, the Vertical Layout Group is set to force expand the button's width and control its size, which isn't set anywhere else. I also don't set any padding/spacing in the Vertical Layout Group and yet there's an empty space between the two buttons.
I want it to look the same at 1080p and 1440p. What am I missing?
unity3d button screen-resolution spacing
|
show 1 more comment
In my game (Unity 2017.3.1f1) I'm using a ScrollView that's filled with buttons at runtime.
At 1080p:

And at 1440p:

The blue dots show the constraints of the Content, the whole thing (including the grey part below) makes up the Scroll View. No matter how big/small I make the Content, the border doesn't vanish at 1440p but is instead resized with the Content.
- The width of the ScrollView is set through a surrounding panel
- The buttons all use the same pefab (Inspector: click) - 1st image below
- The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click) - 2nd image below


As you can see in the last screenshot, the Vertical Layout Group is set to force expand the button's width and control its size, which isn't set anywhere else. I also don't set any padding/spacing in the Vertical Layout Group and yet there's an empty space between the two buttons.
I want it to look the same at 1080p and 1440p. What am I missing?
unity3d button screen-resolution spacing
@Draco18s I already did in the original post, it's the very last link (The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click)) - I added the screenshots directly now too...
– Neph
Nov 14 '18 at 9:19
@Draco18s Do you know what setting of the vertical layout group causes this problem most likely?
– Neph
Nov 16 '18 at 12:46
No, I've messed with layout groups only enough to know that I hate them.
– Draco18s
Nov 16 '18 at 14:21
@Draco18s You saidIts settings aren't sufficientbut what exactly is missing? Any idea what I could try to fix it then (apart from getting rid of the layout group, which I can't do because I need the buttons to be sorted)?
– Neph
Nov 19 '18 at 11:45
When I said that you didn't have a screen shot of its inspector, showing all of its settings. Now you do (or at least, converted it from a link that I hadn't seen), so that comment is no longer relevant.
– Draco18s
Nov 19 '18 at 15:26
|
show 1 more comment
In my game (Unity 2017.3.1f1) I'm using a ScrollView that's filled with buttons at runtime.
At 1080p:

And at 1440p:

The blue dots show the constraints of the Content, the whole thing (including the grey part below) makes up the Scroll View. No matter how big/small I make the Content, the border doesn't vanish at 1440p but is instead resized with the Content.
- The width of the ScrollView is set through a surrounding panel
- The buttons all use the same pefab (Inspector: click) - 1st image below
- The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click) - 2nd image below


As you can see in the last screenshot, the Vertical Layout Group is set to force expand the button's width and control its size, which isn't set anywhere else. I also don't set any padding/spacing in the Vertical Layout Group and yet there's an empty space between the two buttons.
I want it to look the same at 1080p and 1440p. What am I missing?
unity3d button screen-resolution spacing
In my game (Unity 2017.3.1f1) I'm using a ScrollView that's filled with buttons at runtime.
At 1080p:

And at 1440p:

The blue dots show the constraints of the Content, the whole thing (including the grey part below) makes up the Scroll View. No matter how big/small I make the Content, the border doesn't vanish at 1440p but is instead resized with the Content.
- The width of the ScrollView is set through a surrounding panel
- The buttons all use the same pefab (Inspector: click) - 1st image below
- The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click) - 2nd image below


As you can see in the last screenshot, the Vertical Layout Group is set to force expand the button's width and control its size, which isn't set anywhere else. I also don't set any padding/spacing in the Vertical Layout Group and yet there's an empty space between the two buttons.
I want it to look the same at 1080p and 1440p. What am I missing?
unity3d button screen-resolution spacing
unity3d button screen-resolution spacing
edited Nov 14 '18 at 9:23
Neph
asked Nov 13 '18 at 16:19
NephNeph
1581117
1581117
@Draco18s I already did in the original post, it's the very last link (The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click)) - I added the screenshots directly now too...
– Neph
Nov 14 '18 at 9:19
@Draco18s Do you know what setting of the vertical layout group causes this problem most likely?
– Neph
Nov 16 '18 at 12:46
No, I've messed with layout groups only enough to know that I hate them.
– Draco18s
Nov 16 '18 at 14:21
@Draco18s You saidIts settings aren't sufficientbut what exactly is missing? Any idea what I could try to fix it then (apart from getting rid of the layout group, which I can't do because I need the buttons to be sorted)?
– Neph
Nov 19 '18 at 11:45
When I said that you didn't have a screen shot of its inspector, showing all of its settings. Now you do (or at least, converted it from a link that I hadn't seen), so that comment is no longer relevant.
– Draco18s
Nov 19 '18 at 15:26
|
show 1 more comment
@Draco18s I already did in the original post, it's the very last link (The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click)) - I added the screenshots directly now too...
– Neph
Nov 14 '18 at 9:19
@Draco18s Do you know what setting of the vertical layout group causes this problem most likely?
– Neph
Nov 16 '18 at 12:46
No, I've messed with layout groups only enough to know that I hate them.
– Draco18s
Nov 16 '18 at 14:21
@Draco18s You saidIts settings aren't sufficientbut what exactly is missing? Any idea what I could try to fix it then (apart from getting rid of the layout group, which I can't do because I need the buttons to be sorted)?
– Neph
Nov 19 '18 at 11:45
When I said that you didn't have a screen shot of its inspector, showing all of its settings. Now you do (or at least, converted it from a link that I hadn't seen), so that comment is no longer relevant.
– Draco18s
Nov 19 '18 at 15:26
@Draco18s I already did in the original post, it's the very last link (
The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click)) - I added the screenshots directly now too...– Neph
Nov 14 '18 at 9:19
@Draco18s I already did in the original post, it's the very last link (
The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click)) - I added the screenshots directly now too...– Neph
Nov 14 '18 at 9:19
@Draco18s Do you know what setting of the vertical layout group causes this problem most likely?
– Neph
Nov 16 '18 at 12:46
@Draco18s Do you know what setting of the vertical layout group causes this problem most likely?
– Neph
Nov 16 '18 at 12:46
No, I've messed with layout groups only enough to know that I hate them.
– Draco18s
Nov 16 '18 at 14:21
No, I've messed with layout groups only enough to know that I hate them.
– Draco18s
Nov 16 '18 at 14:21
@Draco18s You said
Its settings aren't sufficient but what exactly is missing? Any idea what I could try to fix it then (apart from getting rid of the layout group, which I can't do because I need the buttons to be sorted)?– Neph
Nov 19 '18 at 11:45
@Draco18s You said
Its settings aren't sufficient but what exactly is missing? Any idea what I could try to fix it then (apart from getting rid of the layout group, which I can't do because I need the buttons to be sorted)?– Neph
Nov 19 '18 at 11:45
When I said that you didn't have a screen shot of its inspector, showing all of its settings. Now you do (or at least, converted it from a link that I hadn't seen), so that comment is no longer relevant.
– Draco18s
Nov 19 '18 at 15:26
When I said that you didn't have a screen shot of its inspector, showing all of its settings. Now you do (or at least, converted it from a link that I hadn't seen), so that comment is no longer relevant.
– Draco18s
Nov 19 '18 at 15:26
|
show 1 more comment
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53285226%2funity-button-spacing-differs-at-different-screen-resolutions%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53285226%2funity-button-spacing-differs-at-different-screen-resolutions%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
@Draco18s I already did in the original post, it's the very last link (
The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click)) - I added the screenshots directly now too...– Neph
Nov 14 '18 at 9:19
@Draco18s Do you know what setting of the vertical layout group causes this problem most likely?
– Neph
Nov 16 '18 at 12:46
No, I've messed with layout groups only enough to know that I hate them.
– Draco18s
Nov 16 '18 at 14:21
@Draco18s You said
Its settings aren't sufficientbut what exactly is missing? Any idea what I could try to fix it then (apart from getting rid of the layout group, which I can't do because I need the buttons to be sorted)?– Neph
Nov 19 '18 at 11:45
When I said that you didn't have a screen shot of its inspector, showing all of its settings. Now you do (or at least, converted it from a link that I hadn't seen), so that comment is no longer relevant.
– Draco18s
Nov 19 '18 at 15:26